[PATCH] Fix erfcl(-inf), minor sparc64 ulps update

Jakub Jelinek jakub@redhat.com
Thu Sep 27 14:30:00 GMT 2001


Hi!

erfcl(-inf) gave 0 instead of 2 in quad version. This patch fixes it, plus
updates slightly sparc64 ulps, so that at least float and double tests pass.
Many long double tests fail ATM, but the most common reason is that
test-libm.inc has very imprecise expected results for many functions.

2001-09-27  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/sparc/sparc64/fpu/libm-test-ulps: Update.
	* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfcl): Fix erfc(-inf).

--- libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps.jj	Mon Jul 23 15:19:49 2001
+++ libc/sysdeps/sparc/sparc64/fpu/libm-test-ulps	Thu Sep 27 15:46:56 2001
@@ -562,6 +562,16 @@ ifloat: 1
 Test "j0 (2.0) == 0.22389077914123566805":
 float: 2
 ifloat: 2
+Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1"
+double: 1
+idouble: 1
+float: 1
+ifloat: 1
+Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1"
+double: 1
+idouble: 1
+float: 1
+ifloat: 1
 Test "j0 (8.0) == 0.17165080713755390609":
 float: 1
 ifloat: 1
--- libc/sysdeps/ieee754/ldbl-128/s_erfl.c.jj	Wed Sep 19 06:13:01 2001
+++ libc/sysdeps/ieee754/ldbl-128/s_erfl.c	Thu Sep 27 15:59:19 2001
@@ -816,7 +816,7 @@ weak_alias (__erf, erfl)
   if (ix >= 0x7fff0000)
     {				/* erfc(nan)=nan */
       /* erfc(+-inf)=0,2 */
-      return (long double) (((sign & 0xffff) >> 15) << 1) + one / x;
+      return (long double) (((u_int32_t) sign >> 31) << 1) + one / x;
     }
 
   if (ix < 0x3ffd0000) /* |x| <1/4 */

	Jakub



More information about the Libc-hacker mailing list