This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix expm1l spurious underflows for ldbl-128ibm


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


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