This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix ldbl-96 coshl


Hi!

No idea how the overflowthresold below was computed, it looks close to
2*log(LDBL_MAX), but coshl overflows already at log(LDBL_MAX)+M_LN2l
(0xb.174ddc031aec0eap+10 does not overflow and 0xb.174ddc031aec0ebp+10
already does).

2001-06-04  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Fix
	overflow threshold constant (log(LDBL_MAX)+M_LN2l).

--- libc/sysdeps/ieee754/ldbl-96/e_coshl.c.jj	Wed Jul 14 02:11:28 1999
+++ libc/sysdeps/ieee754/ldbl-96/e_coshl.c	Mon Jun  4 14:20:26 2001
@@ -79,16 +79,15 @@ static long double one = 1.0, half=0.5, 
 	if (ex < 0x400c || (ex == 0x400c && mx < 0xb1700000u))
 		return half*__ieee754_expl(fabsl(x));
 
-    /* |x| in [log(maxdouble), overflowthresold] */
-	if (ex < 0x400d
-	    || (ex == 0x400d && (mx < 0xb170b513u
-				  || (mx == 0xb170b513u && lx < 0xa1dfd60cu))))
+    /* |x| in [log(maxdouble), log(2*maxdouble)) */
+	if (ex == 0x400c && (mx < 0xb174ddc0u
+			     || (mx == 0xb174ddc0u && lx < 0x31aec0ebu)))
 	{
 	    w = __ieee754_expl(half*fabsl(x));
 	    t = half*w;
 	    return t*w;
 	}
 
-    /* |x| > overflowthresold, cosh(x) overflow */
+    /* |x| >= log(2*maxdouble), cosh(x) overflow */
 	return huge*huge;
 }

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]