Fix expm1l spurious underflows for ldbl-128ibm

Joseph S. Myers joseph@codesourcery.com
Wed Nov 21 22:25:00 GMT 2012


The ldbl-128ibm exmp1l implementation has the same problem with
spurious underflow exceptions for large negative inputs that I
previously fixed for some other versions.  Here, it's the code that
returns (4.0/big - 1.0L) in such cases, where 4.0/big underflows for
IBM long double; this patch uses a minimal fix of changing that
variable so 4.0/big no longer underflows (but big * big still
overflows, as required for the overflow case).  As with the existing
code, nothing special is done here for the peculiarities of IBM long
double (where strictly the discontiguous mantissa would allow results
of expm1l with sufficiently negative arguments to be represented much
more exactly than the code tries to do, as long doubles where the high
part is -1.0 and the low part is the result of expl, to double
precision and without underflow exceptions).

Tested that this eliminates the underflow exceptions on powerpc.

2012-11-21  Joseph Myers  <joseph@codesourcery.com>

	[BZ #6778]
	* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (big): Change to 1e290L.

diff --git a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
index 98ae4e1..8808dcd 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c
@@ -85,7 +85,7 @@ static const long double
 /* ln (2^16384 * (1 - 2^-113)) */
   maxlog = 1.1356523406294143949491931077970764891253E4L,
 /* ln 2^-114 */
-  minarg = -7.9018778583833765273564461846232128760607E1L, big = 2e307L;
+  minarg = -7.9018778583833765273564461846232128760607E1L, big = 1e290L;
 
 
 long double

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list