This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix expm1 spurious underflow exceptions (bug 6778)
On 07/06/2012 12:08 AM, Joseph S. Myers wrote:
Bug 6778 is spurious underflow from expm1 (x86 versions, including
x86_64 for expm1l only) for large negative arguments (where exp would
underflow, but expm1 should return a value very close to -1).
This patch fixes this by adding appropriate checks for large negative
arguments to each function. (The new tests of expm1 for negative
arguments are intended to cover ranges around where the result starts
to round to -1 exactly for float, double and the supported long double
formats.)
Tested x86 and x86_64 and ulps updated accordingly.
2012-07-05 Joseph Myers <joseph@codesourcery.com>
[BZ #6778]
* sysdeps/i386/fpu/s_expm1.S (__expm1): Check for large negative
inputs and return -1 for them. Do not check for +Inf in case not
reachable for +Inf.
* sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise.
* sysdeps/i386/fpu/e_expl.S [USE_AS_EXPM1L] (csat): Do not define.
(IEEE754_EXPL) [USE_AS_EXPM1L]: Check for large negative inputs
and return -1 for them. Do not check for +Inf in case not
reachable for +Inf.
* sysdeps/x86_64/fpu/e_expl.S [USE_AS_EXPM1L] (csat): Do not
define.
(IEEE754_EXPL) [USE_AS_EXPM1L]: Check for large negative inputs
and return -1 for them. Do not check for +Inf in case not
reachable for +Inf.
* math/libm-test.inc (expm1_test): Add more tests. Do not allow
spurious underflow.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Thanks, this is ok,
Andreas
--
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