Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You need to integrate the square root of a quartic polynomial – the derivative of a cubic is a quadratic, then you square the norm of that, which gives a quartic. I spent a little time in Mathematica and it there is a solution, but it seems very unlikely to me it's going to be more efficient than numerical integration - it involves finding the roots of a quartic and has nine elliptic function evaluations. From a slide I found[0] it looks like it takes on the order of 100ns to compute an elliptic function, so at best it's still going to be slower than the adaptive quadrature even with an accuracy of 1e-12 or so. Plus there are a lot of divisions by differences of roots, and as each one of those approaches zero there will be numerical stability issues.

Long story short, it looks doable, but is a lot of work to get right and has almost no chance of beating out numerical integration in performance.

[0] http://arith22.gforge.inria.fr/slides/05-fukushima.pdf



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: