Ticket #12066 (new Library Submissions)
Accuracy of modified Bessel functions
|Reported by:||Pavel Holoborodko <pavel@…>||Owned by:||johnmaddock|
|Milestone:||To Be Determined||Component:||math|
This is not a bug report but proposal for enhancement.
Currently Boost is using rational minimax approximations to compute modified Bessel functions in double precision. In short, I propose to replace them with more accurate (and faster) approximations.
I happen to work in the field of high-accuracy computations and accuracy assessment of various software libraries is part of job.
Few months ago I tested accuracy of computing the modified Bessel functions by different software libraries including Boost.
Relative accuracy of every library was evaluated against "true" values computed using quadruple precision (in terms of machine epsilon). Reports with details and plots can be found by the links: (Trac doesn't allow multiple links, so there is only one - others can be easily found)
The main conclusion is:
Rational approximation currently used in Boost were build by minimizing only theoretical approximation error, ignoring effects of finite precision floating-point arithmetic. Which makes them sub-optimal (e.g. Boost delivers the lowest accuracy for I0 with arguments in [0,15]).
To fix this, I searched for approximations which take into account the real-life rounding & cancellation effects - proposed approximations are included in reports.
In most of the cases, new methods deliver the lowest relative error even if compared to Chebyshev expansions and have simple structure (polynomials). I think it would be a big plus for Boost to use the updated coefficients and give highest accuracy among other libs.
My question are:
- Is this of any interest for Boost::math maintainers?
- If yes - I would be happy to help with updating the routines for I0, I1, K0 and K1. (Fork -> pull request would be enough, right?)
P.S. GSL has issues with accuracy (K0, K1) and probably it is not good idea to use it for evaluating accuracy against (I saw tables in Boost documentation with accuracy checks against GSL).