public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/18594] New: cexp, ccos, ccosh, csin, csinh spurious underflows
@ 2015-06-24 20:31 jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` [Bug math/18594] " jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` cvs-commit at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-06-24 20:31 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=18594
Bug ID: 18594
Summary: cexp, ccos, ccosh, csin, csinh spurious underflows
Product: glibc
Version: 2.21
Status: NEW
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: jsm28 at gcc dot gnu.org
Target Milestone: ---
cexp, ccos, ccosh, csin and csinh have spurious underflows in cases where they
compute sin of the smallest normal, that produces an underflow exception
(depending on which sin implementation is in use) but the final result does not
underflow. ctan may also have such underflows, or they may be latent (the
issue there is that e.g. ctan (DBL_MIN) should, rounded upwards, be the next
double value above DBL_MIN, which under glibc's accuracy goals may not have an
underflow exception, but the intermediate computation of sin (DBL_MIN) would
legitimately underflow on before-rounding architectures).
For example, for float on x86_64:
Failure: Real part of: ccos_downward (0x4p-128 + 0x1p+0 i): Exception
"Underflow" set
Failure: Real part of: ccosh_downward (0x1p+0 + 0x4p-128 i): Exception
"Underflow" set
Failure: Real part of: cexp_downward (0x1p+0 + 0x4p-128 i): Exception
"Underflow" set
Failure: Real part of: csin_downward (-0x4p-128 + 0x1p+0 i): Exception
"Underflow" set
Failure: Real part of: csinh_downward (0x1p+0 + 0x4p-128 i): Exception
"Underflow" set
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug math/18594] cexp, ccos, ccosh, csin, csinh spurious underflows
2015-06-24 20:31 [Bug math/18594] New: cexp, ccos, ccosh, csin, csinh spurious underflows jsm28 at gcc dot gnu.org
@ 2015-06-24 21:06 ` jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` cvs-commit at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-06-24 21:06 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=18594
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Fixed for 2.22.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug math/18594] cexp, ccos, ccosh, csin, csinh spurious underflows
2015-06-24 20:31 [Bug math/18594] New: cexp, ccos, ccosh, csin, csinh spurious underflows jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` [Bug math/18594] " jsm28 at gcc dot gnu.org
@ 2015-06-24 21:06 ` cvs-commit at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-06-24 21:06 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=18594
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via a67894c505d44c3a5292804c37d318684d2be469 (commit)
from 010186901d16060a5d1178cc0f2f59199228b99a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a67894c505d44c3a5292804c37d318684d2be469
commit a67894c505d44c3a5292804c37d318684d2be469
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Jun 24 21:04:51 2015 +0000
Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594).
cexp, ccos, ccosh, csin and csinh have spurious underflows in cases
where they compute sin of the smallest normal, that produces an
underflow exception (depending on which sin implementation is in use)
but the final result does not underflow. ctan and ctanh may also have
such underflows, or they may be latent (the issue there is that
e.g. ctan (DBL_MIN) should, rounded upwards, be the next double value
above DBL_MIN, which under glibc's accuracy goals may not have an
underflow exception, but the intermediate computation of sin (DBL_MIN)
would legitimately underflow on before-rounding architectures).
This patch fixes all those functions so they use plain comparisons (>
DBL_MIN etc.) instead of comparing the result of fpclassify with
FP_SUBNORMAL (in all these cases, we already know the number being
compared is finite). Note that in the case of csin / csinf / csinl,
there is no need for fabs calls in the comparison because the real
part has already been reduced to its absolute value.
As the patch fixes the failures that previously obstructed moving
tests of cexp to use ALL_RM_TEST, those tests are moved to ALL_RM_TEST
by the patch (two functions remain yet to be converted).
Tested for x86_64 and x86 and ulps updated accordingly.
[BZ #18594]
* math/s_ccosh.c (__ccosh): Compare with least normal value
instead of comparing class with FP_SUBNORMAL.
* math/s_ccoshf.c (__ccoshf): Likewise.
* math/s_ccoshl.c (__ccoshl): Likewise.
* math/s_cexp.c (__cexp): Likewise.
* math/s_cexpf.c (__cexpf): Likewise.
* math/s_cexpl.c (__cexpl): Likewise.
* math/s_csin.c (__csin): Likewise.
* math/s_csinf.c (__csinf): Likewise.
* math/s_csinh.c (__csinh): Likewise.
* math/s_csinhf.c (__csinhf): Likewise.
* math/s_csinhl.c (__csinhl): Likewise.
* math/s_csinl.c (__csinl): Likewise.
* math/s_ctan.c (__ctan): Likewise.
* math/s_ctanf.c (__ctanf): Likewise.
* math/s_ctanh.c (__ctanh): Likewise.
* math/s_ctanhf.c (__ctanhf): Likewise.
* math/s_ctanhl.c (__ctanhl): Likewise.
* math/s_ctanl.c (__ctanl): Likewise.
* math/auto-libm-test-in: Add more tests of ccos, ccosh, cexp,
csin, csinh, ctan and ctanh.
* math/auto-libm-test-out: Regenerated.
* math/libm-test.inc (cexp_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 29 +
NEWS | 2 +-
math/auto-libm-test-in | 37 +
math/auto-libm-test-out | 2212 +++++++++++++++++++++++++++++++++++++
math/libm-test.inc | 4 +-
math/s_ccosh.c | 4 +-
math/s_ccoshf.c | 4 +-
math/s_ccoshl.c | 4 +-
math/s_cexp.c | 4 +-
math/s_cexpf.c | 4 +-
math/s_cexpl.c | 4 +-
math/s_csin.c | 4 +-
math/s_csinf.c | 4 +-
math/s_csinh.c | 4 +-
math/s_csinhf.c | 4 +-
math/s_csinhl.c | 4 +-
math/s_csinl.c | 4 +-
math/s_ctan.c | 3 +-
math/s_ctanf.c | 2 +-
math/s_ctanh.c | 3 +-
math/s_ctanhf.c | 2 +-
math/s_ctanhl.c | 3 +-
math/s_ctanl.c | 3 +-
sysdeps/i386/fpu/libm-test-ulps | 52 +
sysdeps/x86_64/fpu/libm-test-ulps | 52 +
25 files changed, 2414 insertions(+), 38 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-24 21:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24 20:31 [Bug math/18594] New: cexp, ccos, ccosh, csin, csinh spurious underflows jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` [Bug math/18594] " jsm28 at gcc dot gnu.org
2015-06-24 21:06 ` cvs-commit at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).