about summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-02-25 00:01:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-02-25 00:01:15 +0000
commit440169d681cc9f422e8486f1324079bef0e0c35a (patch)
tree9b732f618ba081518cf0cca84ef33328526a4633 /sysdeps/ieee754
parentba7d2c543f7d69883ece7eab39bf6c5cd5dc3081 (diff)
downloadglibc-440169d681cc9f422e8486f1324079bef0e0c35a.tar.gz
glibc-440169d681cc9f422e8486f1324079bef0e0c35a.tar.xz
glibc-440169d681cc9f422e8486f1324079bef0e0c35a.zip
Fix ldbl-128ibm acoshl inaccuracy (bug 18019).
The ldbl-128ibm implementation of acoshl uses a cut-off of 0x1p28 to
determine when to use log(x) + log(2) as a formula.  That cut-off is
too small for this format, resulting in large errors.  This patch
changes it to a more appropriate cut-off of 0x1p56, adding tests
around the cut-offs for various floating-point formats.

Tested for powerpc.  Also tested for x86_64 and x86 and updated ulps.

	[BZ #18019]
	* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Use
	2**56 not 2**28 as threshold for log (2x) formula.
	* math/auto-libm-test-in: Add more tests of acosh.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_acoshl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index b0b33f7520..cab1da9995 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -44,14 +44,14 @@ __ieee754_acoshl(long double x)
 	EXTRACT_WORDS64 (lx, xlo);
 	if(hx<0x3ff0000000000000LL) {		/* x < 1 */
 	    return (x-x)/(x-x);
-	} else if(hx >=0x41b0000000000000LL) {	/* x > 2**28 */
+	} else if(hx >=0x4370000000000000LL) {	/* x >= 2**56 */
 	    if(hx >=0x7ff0000000000000LL) {	/* x is inf of NaN */
 		return x+x;
 	    } else
 		return __ieee754_logl(x)+ln2;	/* acosh(huge)=log(2x) */
 	} else if (((hx-0x3ff0000000000000LL)|(lx&0x7fffffffffffffffLL))==0) {
 	    return 0.0;			/* acosh(1) = 0 */
-	} else if (hx > 0x4000000000000000LL) {	/* 2**28 > x > 2 */
+	} else if (hx > 0x4000000000000000LL) {	/* 2**56 > x > 2 */
 	    t=x*x;
 	    return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
 	} else {			/* 1<x<2 */