Message ID | alpine.DEB.2.10.1508101525360.24619@digraph.polyomino.org.uk |
---|---|
State | New |
Headers | show |
On Mon, 2015-08-10 at 15:26 +0000, Joseph Myers wrote: > ldbl-128ibm sinhl uses a too-big threshold to decide when to return > the argument, resulting in large errors. This patch fixes it to use a > more appropriate threshold. > > Tested for x86_64, x86 and powerpc. Committed. > > (auto-libm-test-out diffs omitted below.) > > 2015-08-10 Joseph Myers <joseph@codesourcery.com> > > [BZ #18789] > * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl): Use > smaller threshold for returning the argument. > * math/auto-libm-test-in: Add more tests of sinh. > * math/auto-libm-test-out: Regenerated. > * sysdeps/i386/fpu/libm-test-ulps: Update. > snip .. > diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c > index 08e5d86..00115df 100644 > --- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c > +++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c > @@ -53,7 +53,7 @@ __ieee754_sinhl(long double x) > if (jx<0) h = -h; > /* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */ > if (ix < 0x4044000000000000LL) { /* |x|<40 */ > - if (ix<0x3e20000000000000LL) { /* |x|<2**-29 */ > + if (ix<0x3c90000000000000LL) { /* |x|<2**-54 */ > if (fabsl (x) < LDBL_MIN) > { > long double force_underflow = x * x; > This looks like a thinko form the original ldbl-128ibm port. Thanks for catching this.
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index bb6d30e..c33334c 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -2508,6 +2508,28 @@ sinh 0 sinh -0 sinh 0.75 sinh 0x8p-32 +sinh 0x1p-5 +sinh -0x1p-5 +sinh 0x1p-10 +sinh -0x1p-10 +sinh 0x1p-20 +sinh -0x1p-20 +sinh 0x1p-30 +sinh -0x1p-30 +sinh 0x1p-40 +sinh -0x1p-40 +sinh 0x1p-50 +sinh -0x1p-50 +sinh 0x1p-60 +sinh -0x1p-60 +sinh 0x1p-70 +sinh -0x1p-70 +sinh 0x1p-100 +sinh -0x1p-100 +sinh 0x1p-1000 +sinh -0x1p-1000 +sinh 0x1p-10000 +sinh -0x1p-10000 sinh 22 sinh 23 sinh 24 diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index a11dd38..eddb3dc 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -1872,6 +1872,8 @@ ildouble: 4 ldouble: 5 Function: "sinh_towardzero": +idouble: 1 +ifloat: 1 ildouble: 3 ldouble: 4 diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c index 08e5d86..00115df 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c @@ -53,7 +53,7 @@ __ieee754_sinhl(long double x) if (jx<0) h = -h; /* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */ if (ix < 0x4044000000000000LL) { /* |x|<40 */ - if (ix<0x3e20000000000000LL) { /* |x|<2**-29 */ + if (ix<0x3c90000000000000LL) { /* |x|<2**-54 */ if (fabsl (x) < LDBL_MIN) { long double force_underflow = x * x;