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]

Re: Fix expm1l spurious underflows for ldbl-128ibm


On 11/21/2012 11:25 PM, Joseph S. Myers wrote:
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.

Thanks, this is fine, Andreas

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




--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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