]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]
authorPaul Zimmermann <Paul.Zimmermann@inria.fr>
Thu, 1 Apr 2021 06:14:10 +0000 (08:14 +0200)
committerPaul Zimmermann <Paul.Zimmermann@inria.fr>
Fri, 2 Apr 2021 04:15:48 +0000 (06:15 +0200)
commit9acda61d94acc5348c2330f2519a14d1a4a37e73
treedcad90e95870279c37b5be7c646b3a3f6edc15cb
parent595c22ecd8e87a27fd19270ed30fdbae9ad25426
Fix the inaccuracy of j0f/j1f/y0f/y1f [BZ #14469, #14470, #14471, #14472]

For j0f/j1f/y0f/y1f, the largest error for all binary32
inputs is reduced to at most 9 ulps for all rounding modes.

The new code is enabled only when there is a cancellation at the very end of
the j0f/j1f/y0f/y1f computation, or for very large inputs, thus should not
give any visible slowdown on average.  Two different algorithms are used:

* around the first 64 zeros of j0/j1/y0/y1, approximation polynomials of
  degree 3 are used, computed using the Sollya tool (https://www.sollya.org/)

* for large inputs, an asymptotic formula from [1] is used

[1] Fast and Accurate Bessel Function Computation,
    John Harrison, Proceedings of Arith 19, 2009.

Inputs yielding the new largest errors are added to auto-libm-test-in,
and ulps are regenerated for various targets (thanks Adhemerval Zanella).

Tested on x86_64 with --disable-multi-arch and on powerpc64le-linux-gnu.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
13 files changed:
math/auto-libm-test-in
math/auto-libm-test-out-j0
math/auto-libm-test-out-j1
math/auto-libm-test-out-y0
math/auto-libm-test-out-y1
sysdeps/aarch64/libm-test-ulps
sysdeps/ieee754/flt-32/e_j0f.c
sysdeps/ieee754/flt-32/e_j1f.c
sysdeps/ieee754/flt-32/reduce_aux.h [new file with mode: 0644]
sysdeps/powerpc/fpu/libm-test-ulps
sysdeps/s390/fpu/libm-test-ulps
sysdeps/sparc/fpu/libm-test-ulps
sysdeps/x86_64/fpu/libm-test-ulps