about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/fpu/e_acosh.S1
-rw-r--r--sysdeps/i386/fpu/e_acoshf.S1
-rw-r--r--sysdeps/i386/fpu/e_acoshl.S1
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps12
-rw-r--r--sysdeps/ieee754/ldbl-96/e_acoshl.c2
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps15
6 files changed, 31 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_acosh.S b/sysdeps/i386/fpu/e_acosh.S
index 98a329179b..c66781c985 100644
--- a/sysdeps/i386/fpu/e_acosh.S
+++ b/sysdeps/i386/fpu/e_acosh.S
@@ -52,6 +52,7 @@ ENTRY(__ieee754_acosh)
 
 	// 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
 	fsubl	MO(one)			// x-1 : log(2)
+	fabs				// acosh(1) is +0 in all rounding modes
 	fld	%st			// x-1 : x-1 : log(2)
 	fmul	%st(1)			// (x-1)^2 : x-1 : log(2)
 	fadd	%st(1)			// x-1+(x-1)^2 : x-1 : log(2)
diff --git a/sysdeps/i386/fpu/e_acoshf.S b/sysdeps/i386/fpu/e_acoshf.S
index db9cf337b2..fa35d50fd0 100644
--- a/sysdeps/i386/fpu/e_acoshf.S
+++ b/sysdeps/i386/fpu/e_acoshf.S
@@ -52,6 +52,7 @@ ENTRY(__ieee754_acoshf)
 
 	// 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
 	fsubl	MO(one)			// x-1 : log(2)
+	fabs				// acosh(1) is +0 in all rounding modes
 	fld	%st			// x-1 : x-1 : log(2)
 	fmul	%st(1)			// (x-1)^2 : x-1 : log(2)
 	fadd	%st(1)			// x-1+(x-1)^2 : x-1 : log(2)
diff --git a/sysdeps/i386/fpu/e_acoshl.S b/sysdeps/i386/fpu/e_acoshl.S
index a832155d17..38d8110550 100644
--- a/sysdeps/i386/fpu/e_acoshl.S
+++ b/sysdeps/i386/fpu/e_acoshl.S
@@ -59,6 +59,7 @@ ENTRY(__ieee754_acoshl)
 
 	// 1 <= x <= 2 => y = log1p(x-1+sqrt(2*(x-1)+(x-1)^2))
 	fsubl	MO(one)			// x-1 : log(2)
+	fabs				// acosh(1) is +0 in all rounding modes
 	fld	%st			// x-1 : x-1 : log(2)
 	fmul	%st(1)			// (x-1)^2 : x-1 : log(2)
 	fadd	%st(1)			// x-1+(x-1)^2 : x-1 : log(2)
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index aea6c51b23..ccef44ac63 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -21,6 +21,18 @@ Function: "acos_upward":
 ildouble: 1
 ldouble: 1
 
+Function: "acosh_downward":
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_towardzero":
+ildouble: 2
+ldouble: 2
+
+Function: "acosh_upward":
+ildouble: 1
+ldouble: 1
+
 Function: "asin_downward":
 double: 1
 float: 1
diff --git a/sysdeps/ieee754/ldbl-96/e_acoshl.c b/sysdeps/ieee754/ldbl-96/e_acoshl.c
index bbaef680bd..cf9a6db0ef 100644
--- a/sysdeps/ieee754/ldbl-96/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-96/e_acoshl.c
@@ -48,7 +48,7 @@ __ieee754_acoshl(long double x)
 		return x+x;
 	    } else
 		return __ieee754_logl(x)+ln2;	/* acoshl(huge)=logl(2x) */
-	} else if(((se-0x3fff)|i0|i1)==0) {
+	} else if(((se-0x3fff)|(i0^0x80000000)|i1)==0) {
 	    return 0.0;			/* acosh(1) = 0 */
 	} else if (se > 0x4000) {	/* 2**28 > x > 2 */
 	    t=x*x;
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index 4ba83a46fd..ad8ae9ce5c 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -31,6 +31,21 @@ Function: "acosh":
 double: 1
 idouble: 1
 
+Function: "acosh_downward":
+float: 1
+ildouble: 1
+ldouble: 2
+
+Function: "acosh_towardzero":
+float: 1
+ildouble: 1
+ldouble: 2
+
+Function: "acosh_upward":
+double: 1
+ildouble: 1
+ldouble: 1
+
 Function: "asin_downward":
 double: 1
 float: 1