mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Fixed inaccuracy of j0f (BZ #28185)
The largest errors over the full binary32 range are after this patch (on x86_64): RNDN: libm wrong by up to 9.00e+00 ulp(s) [9] for x=0x1.04c39cp+6 RNDZ: libm wrong by up to 9.00e+00 ulp(s) [9] for x=0x1.04c39cp+6 RNDU: libm wrong by up to 9.00e+00 ulp(s) [9] for x=0x1.04c39cp+6 RNDD: libm wrong by up to 8.98e+00 ulp(s) [9] for x=0x1.4b7066p+7 Inputs that were yielding huge errors have been added to "make check". Reviewed-by: Adhemeral Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
a312e8fe6d
commit
6bbf729832
@ -5806,6 +5806,51 @@ j0 0x1.04c39cp+6
|
||||
j0 0x1.4b7066p+7
|
||||
# the next value exercises the flt-32 code path for x >= 2^127
|
||||
j0 0x8.2f4ecp+124
|
||||
# the next values gave an error > 9 ulps with glibc-2.34 (flt-32)
|
||||
j0 0x1.31ec02p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.31e716p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.31f51ep+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.320226p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.31ed76p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32083cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32614ep+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32dc02p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32e304p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32e00cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32e504p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32e12p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32dc22p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32dc24p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32eb18p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.32fa0cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.335806p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.335a0cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.336p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.336c1cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.336336p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33712ep+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.339506p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33950cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.339d06p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33b402p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33b50ap+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c4p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c202p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c702p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c50ap+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c312p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33c80ap+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33cb04p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33cfp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d1p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d102p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d10cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d116p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d12cp+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d138p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d146p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d15p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
j0 0x1.33d152p+1 xfail:binary64 xfail:intel96 xfail:binary128
|
||||
|
||||
j1 -1.0
|
||||
j1 0.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,7 @@ S04 = 1.1661400734e-09; /* 0x30a045e8 */
|
||||
static const float zero = 0.0;
|
||||
|
||||
/* This is the nearest approximation of the first zero of j0. */
|
||||
#define FIRST_ZERO_J0 0xf.26247p-28f
|
||||
#define FIRST_ZERO_J0 0x1.33d152p+1f
|
||||
|
||||
#define SMALL_SIZE 64
|
||||
|
||||
@ -211,7 +211,7 @@ j0f_asympt (float x)
|
||||
/* Now x - pi/4 - alpha0 = h + n*pi/2 mod (2*pi). */
|
||||
float xr = (float) h;
|
||||
n = n & 3;
|
||||
float cst = 0xc.c422ap-4; /* sqrt(2/pi) rounded to nearest */
|
||||
float cst = 0xc.c422ap-4f; /* sqrt(2/pi) rounded to nearest */
|
||||
float t = cst / sqrtf (x) * (float) beta0;
|
||||
if (n == 0)
|
||||
return t * __cosf (xr);
|
||||
@ -285,7 +285,7 @@ __ieee754_j0f(float x)
|
||||
/* The following threshold is optimal: for x=0x1.3b58dep+1
|
||||
and rounding upwards, |cc|=0x1.579b26p-4 and z is 10 ulps
|
||||
far from the correctly rounded value. */
|
||||
float threshold = 0x1.579b26p-4;
|
||||
float threshold = 0x1.579b26p-4f;
|
||||
if (fabsf (cc) > threshold)
|
||||
return z;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user