about summary refs log tree commit diff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorPaul Zimmermann <Paul.Zimmermann@inria.fr>2021-04-01 08:14:10 +0200
committerPaul Zimmermann <Paul.Zimmermann@inria.fr>2021-04-02 06:15:48 +0200
commit9acda61d94acc5348c2330f2519a14d1a4a37e73 (patch)
treedcad90e95870279c37b5be7c646b3a3f6edc15cb /sysdeps/x86_64
parent595c22ecd8e87a27fd19270ed30fdbae9ad25426 (diff)
downloadglibc-9acda61d94acc5348c2330f2519a14d1a4a37e73.tar.gz
glibc-9acda61d94acc5348c2330f2519a14d1a4a37e73.tar.xz
glibc-9acda61d94acc5348c2330f2519a14d1a4a37e73.zip
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>
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps76
1 files changed, 38 insertions, 38 deletions
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index bd1fa63702..0edb95e14c 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -1317,50 +1317,50 @@ ldouble: 1
 
 Function: "j0":
 double: 2
-float: 8
+float: 9
 float128: 2
-ldouble: 2
+ldouble: 8
 
 Function: "j0_downward":
-double: 2
-float: 4
-float128: 4
+double: 5
+float: 9
+float128: 9
 ldouble: 6
 
 Function: "j0_towardzero":
-double: 5
-float: 6
-float128: 4
+double: 6
+float: 9
+float128: 9
 ldouble: 6
 
 Function: "j0_upward":
-double: 4
-float: 5
-float128: 5
+double: 9
+float: 9
+float128: 7
 ldouble: 6
 
 Function: "j1":
-double: 2
+double: 4
 float: 9
 float128: 4
-ldouble: 5
+ldouble: 9
 
 Function: "j1_downward":
-double: 3
-float: 5
-float128: 4
-ldouble: 4
+double: 6
+float: 8
+float128: 6
+ldouble: 8
 
 Function: "j1_towardzero":
-double: 3
-float: 2
-float128: 4
+double: 4
+float: 9
+float128: 9
 ldouble: 4
 
 Function: "j1_upward":
-double: 3
-float: 5
-float128: 3
+double: 9
+float: 9
+float128: 9
 ldouble: 3
 
 Function: "jn":
@@ -1753,27 +1753,27 @@ ldouble: 5
 
 Function: "y0":
 double: 3
-float: 8
+float: 9
 float128: 3
-ldouble: 1
+ldouble: 2
 
 Function: "y0_downward":
-double: 3
-float: 6
-float128: 4
-ldouble: 5
+double: 4
+float: 9
+float128: 7
+ldouble: 7
 
 Function: "y0_towardzero":
-double: 3
-float: 3
+double: 4
+float: 9
 float128: 3
-ldouble: 6
+ldouble: 8
 
 Function: "y0_upward":
 double: 3
-float: 6
-float128: 3
-ldouble: 5
+float: 9
+float128: 4
+ldouble: 7
 
 Function: "y1":
 double: 6
@@ -1782,14 +1782,14 @@ float128: 5
 ldouble: 3
 
 Function: "y1_downward":
-double: 3
-float: 2
+double: 6
+float: 9
 float128: 5
 ldouble: 7
 
 Function: "y1_towardzero":
 double: 4
-float: 5
+float: 9
 float128: 6
 ldouble: 5