public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16800] New: __ieee754_logf incorrect for 0 in round-downward mode
@ 2014-04-02 14:15 jsm28 at gcc dot gnu.org
2014-04-02 17:42 ` [Bug math/16800] " cvs-commit at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-04-02 14:15 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=16800
Bug ID: 16800
Summary: __ieee754_logf incorrect for 0 in round-downward mode
Product: glibc
Version: 2.19
Status: NEW
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: jsm28 at gcc dot gnu.org
sysdeps/ieee754/flt-32/e_logf.c does
if (__builtin_expect((ix&0x7fffffff)==0, 0))
return -two25/(x-x); /* log(+-0)=-inf */
which actually returns +Inf in round-downward mode. (Because of the wrappers,
this is only actually visible when -lieee is used - not covered by the
testsuite - and indirectly for other functions such as catan / catanh that can
call __ieee754_logf directly in this case.)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/16800] __ieee754_logf incorrect for 0 in round-downward mode
2014-04-02 14:15 [Bug math/16800] New: __ieee754_logf incorrect for 0 in round-downward mode jsm28 at gcc dot gnu.org
@ 2014-04-02 17:42 ` cvs-commit at gcc dot gnu.org
2014-04-02 17:42 ` jsm28 at gcc dot gnu.org
2014-06-12 19:49 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-04-02 17:42 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=16800
--- 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 a84e78c8b3c4de94b488fdc5321f71feeb99358f (commit)
from 6f05bafebac30a389807979f8efbb709f84b486f (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=a84e78c8b3c4de94b488fdc5321f71feeb99358f
commit a84e78c8b3c4de94b488fdc5321f71feeb99358f
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Apr 2 17:41:02 2014 +0000
Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug
16800).
This patch fixes incorrect results from catan and catanh of certain
special inputs in round-downward mode (bug 16799), and incorrect
results of __ieee754_logf (+/-0) in round-downward mode (bug 16800)
that show up through catan/catanh when tested in all rounding modes,
but not directly in the testing for logf because the bug gets hidden
by the wrappers.
Both bugs involve a zero that should be +0 being -0 instead: one
computed as (1-x)*(1+x) in the catan/catanh case, and one as (x-x) in
the logf case. The fixes ensure positive zero is used. Testing of
catan and catanh in all rounding modes is duly enabled.
I expect there are various other bugs in special cases in __ieee754_*
functions that are normally hidden by the wrappers but would show up
for testing with -lieee (or in future with -fno-math-errno if we
replace -lieee and _LIB_VERSION with compile-time redirection to new
*_noerrno symbol names).
Tested x86_64 and x86 and ulps updated accordingly.
[BZ #16799]
[BZ #16800]
* math/s_catan.c (__catan): Avoid passing -0 denominator to atan2
with 0 numerator.
* math/s_catanf.c (__catanf): Likewise.
* math/s_catanh.c (__catanh): Likewise.
* math/s_catanhf.c (__catanhf): Likewise.
* math/s_catanhl.c (__catanhl): Likewise.
* math/s_catanl.c (__catanl): Likewise.
* sysdeps/ieee754/flt-32/e_logf.c (__ieee754_logf): Always divide
by positive zero when computing -Inf result.
* math/libm-test.inc (catan_test): Use ALL_RM_TEST.
(catanh_test): Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 ++++++
NEWS | 2 +-
math/libm-test.inc | 8 +--
math/s_catan.c | 6 ++-
math/s_catanf.c | 6 ++-
math/s_catanh.c | 6 ++-
math/s_catanhf.c | 6 ++-
math/s_catanhl.c | 6 ++-
math/s_catanl.c | 6 ++-
sysdeps/i386/fpu/libm-test-ulps | 96 +++++++++++++++++++++++++++++++++++++
sysdeps/ieee754/flt-32/e_logf.c | 2 +-
sysdeps/x86_64/fpu/libm-test-ulps | 96 +++++++++++++++++++++++++++++++++++++
12 files changed, 242 insertions(+), 14 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/16800] __ieee754_logf incorrect for 0 in round-downward mode
2014-04-02 14:15 [Bug math/16800] New: __ieee754_logf incorrect for 0 in round-downward mode jsm28 at gcc dot gnu.org
2014-04-02 17:42 ` [Bug math/16800] " cvs-commit at gcc dot gnu.org
@ 2014-04-02 17:42 ` jsm28 at gcc dot gnu.org
2014-06-12 19:49 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-04-02 17:42 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=16800
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.20.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/16800] __ieee754_logf incorrect for 0 in round-downward mode
2014-04-02 14:15 [Bug math/16800] New: __ieee754_logf incorrect for 0 in round-downward mode jsm28 at gcc dot gnu.org
2014-04-02 17:42 ` [Bug math/16800] " cvs-commit at gcc dot gnu.org
2014-04-02 17:42 ` jsm28 at gcc dot gnu.org
@ 2014-06-12 19:49 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-12 19:49 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=16800
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |security-
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-12 19:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 14:15 [Bug math/16800] New: __ieee754_logf incorrect for 0 in round-downward mode jsm28 at gcc dot gnu.org
2014-04-02 17:42 ` [Bug math/16800] " cvs-commit at gcc dot gnu.org
2014-04-02 17:42 ` jsm28 at gcc dot gnu.org
2014-06-12 19:49 ` fweimer at redhat dot com
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).