public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/10709] New: sin() returns incorrect rounding
@ 2009-09-30 12:51 zimmerma+gcc at loria dot fr
2009-09-30 12:58 ` [Bug math/10709] " zimmerma+gcc at loria dot fr
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2009-09-30 12:51 UTC (permalink / raw)
To: glibc-bugs
for the double precision number closest to 2.522464e-1, the glibc sin() function
returns 2.4957989804940914e-01 (when printed to 17 digits, which identifies
uniquely double-precision numbers), whereas the correct rounding to nearest is
2.4957989804940911e-01.
According to glibc/sysdeps/ieee754/dbl-64/s_sin.c, the result should be
always correctly rounded.
--
Summary: sin() returns incorrect rounding
Product: glibc
Version: 2.10
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: aj at suse dot de
ReportedBy: zimmerma+gcc at loria dot fr
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: x86_64-redhat-linux
GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux
http://sourceware.org/bugzilla/show_bug.cgi?id=10709
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/10709] sin() returns incorrect rounding
2009-09-30 12:51 [Bug math/10709] New: sin() returns incorrect rounding zimmerma+gcc at loria dot fr
@ 2009-09-30 12:58 ` zimmerma+gcc at loria dot fr
2009-09-30 13:07 ` zimmerma+gcc at loria dot fr
2010-03-21 22:20 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 4+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2009-09-30 12:58 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From zimmerma+gcc at loria dot fr 2009-09-30 12:57 -------
Created an attachment (id=4236)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4236&action=view)
test case
compile with -fno-builtin to ensure the sin() call is not folded at
compile-time
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10709
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/10709] sin() returns incorrect rounding
2009-09-30 12:51 [Bug math/10709] New: sin() returns incorrect rounding zimmerma+gcc at loria dot fr
2009-09-30 12:58 ` [Bug math/10709] " zimmerma+gcc at loria dot fr
@ 2009-09-30 13:07 ` zimmerma+gcc at loria dot fr
2010-03-21 22:20 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 4+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2009-09-30 13:07 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From zimmerma+gcc at loria dot fr 2009-09-30 13:07 -------
This bug is analyzed and a fix is proposed at
<http://www.loria.fr/~zimmerma/papers/bug10709.pdf>.
In short, it suffices to replace the line:
return (res==res+1.025*cor)? res : slow1(x);
in file glibc/sysdeps/ieee754/dbl-64/s_sin.c by:
return (res==res+1.096*cor)? res : slow1(x);
Paul Zimmermann
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10709
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug math/10709] sin() returns incorrect rounding
2009-09-30 12:51 [Bug math/10709] New: sin() returns incorrect rounding zimmerma+gcc at loria dot fr
2009-09-30 12:58 ` [Bug math/10709] " zimmerma+gcc at loria dot fr
2009-09-30 13:07 ` zimmerma+gcc at loria dot fr
@ 2010-03-21 22:20 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 4+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-03-21 22:20 UTC (permalink / raw)
To: glibc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |vincent+libc at vinc17 dot
| |org
http://sourceware.org/bugzilla/show_bug.cgi?id=10709
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-21 22:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30 12:51 [Bug math/10709] New: sin() returns incorrect rounding zimmerma+gcc at loria dot fr
2009-09-30 12:58 ` [Bug math/10709] " zimmerma+gcc at loria dot fr
2009-09-30 13:07 ` zimmerma+gcc at loria dot fr
2010-03-21 22:20 ` vincent+libc at vinc17 dot 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).