public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug math/1163] New: sinf inaccurate for some inputs @ 2005-08-03 23:32 bob dot wilson at acm dot org 2005-10-15 23:47 ` [Bug math/1163] " drepper at redhat dot com ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: bob dot wilson at acm dot org @ 2005-08-03 23:32 UTC (permalink / raw) To: glibc-bugs The version of sinf() in sysdeps/ieee754/flt-32/ gives results that are wrong by more than 1 ulp for at least some inputs. The testcase below will demonstrate the problem for sinf(8.203124e-01). The output from this test on an x86_64 platform running RH Enterprise 3 is: inputs: a = 8.203124e-01 actual = 7.3135888576508e-01 (0x3f3b3a56) expected = 7.3135894536972e-01 (0x3f3b3a57) sin(a) = 7.3135894750029e-01 The sinf() result is 1 ulp smaller than the expected value, which is already slightly smaller than the real answer. Other math libraries derived from fdlibm (e.g., newlib) have the same problem. The test program is: #include <stdio.h> #include <math.h> unsigned int ta = 0x3f51ffff; main () { float a = *(float *)&ta; float c = sinf(a); float d = sin(a); printf("inputs: a = %e\n", a); printf("actual =\t%.13e\t(0x%08x)\n", c, *(unsigned *)&c); printf("expected =\t%.13e\t(0x%08x)\n", d, *(unsigned *)&d); printf("sin(a) =\t%.13e\n", sin(a)); } -- Summary: sinf inaccurate for some inputs Product: glibc Version: 2.3.2 Status: NEW Severity: minor Priority: P3 Component: math AssignedTo: aj at suse dot de ReportedBy: bob dot wilson at acm dot org CC: glibc-bugs at sources dot redhat dot com GCC host triplet: x86_64-redhat-linux http://sources.redhat.com/bugzilla/show_bug.cgi?id=1163 ------- 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] 5+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs 2005-08-03 23:32 [Bug math/1163] New: sinf inaccurate for some inputs bob dot wilson at acm dot org @ 2005-10-15 23:47 ` drepper at redhat dot com 2005-12-30 9:33 ` aj at suse dot de ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: drepper at redhat dot com @ 2005-10-15 23:47 UTC (permalink / raw) To: glibc-bugs ------- Additional Comments From drepper at redhat dot com 2005-10-15 23:47 ------- Once somebody provides a better implementation we can use it. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |drepper at redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=1163 ------- 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] 5+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs 2005-08-03 23:32 [Bug math/1163] New: sinf inaccurate for some inputs bob dot wilson at acm dot org 2005-10-15 23:47 ` [Bug math/1163] " drepper at redhat dot com @ 2005-12-30 9:33 ` aj at suse dot de 2008-03-29 4:28 ` jvdelisle at gcc dot gnu dot org 2008-03-29 4:31 ` jvdelisle at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: aj at suse dot de @ 2005-12-30 9:33 UTC (permalink / raw) To: glibc-bugs ------- Additional Comments From aj at suse dot de 2005-12-30 09:33 ------- We will not change this unless somebody provides a better implementation. -- What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |SUSPENDED http://sourceware.org/bugzilla/show_bug.cgi?id=1163 ------- 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] 5+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs 2005-08-03 23:32 [Bug math/1163] New: sinf inaccurate for some inputs bob dot wilson at acm dot org 2005-10-15 23:47 ` [Bug math/1163] " drepper at redhat dot com 2005-12-30 9:33 ` aj at suse dot de @ 2008-03-29 4:28 ` jvdelisle at gcc dot gnu dot org 2008-03-29 4:31 ` jvdelisle at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: jvdelisle at gcc dot gnu dot org @ 2008-03-29 4:28 UTC (permalink / raw) To: glibc-bugs ------- Additional Comments From jvdelisle at gcc dot gnu dot org 2008-03-29 04:28 ------- Also see gcc bug 34128 where g77 uses sin and gfortran uses sinf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34128 sinf is grossly slower. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1163 ------- 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] 5+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs 2005-08-03 23:32 [Bug math/1163] New: sinf inaccurate for some inputs bob dot wilson at acm dot org ` (2 preceding siblings ...) 2008-03-29 4:28 ` jvdelisle at gcc dot gnu dot org @ 2008-03-29 4:31 ` jvdelisle at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: jvdelisle at gcc dot gnu dot org @ 2008-03-29 4:31 UTC (permalink / raw) To: glibc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- CC| |jvdelisle at gcc dot gnu dot | |org http://sourceware.org/bugzilla/show_bug.cgi?id=1163 ------- 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] 5+ messages in thread
end of thread, other threads:[~2008-03-29 4:31 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-08-03 23:32 [Bug math/1163] New: sinf inaccurate for some inputs bob dot wilson at acm dot org 2005-10-15 23:47 ` [Bug math/1163] " drepper at redhat dot com 2005-12-30 9:33 ` aj at suse dot de 2008-03-29 4:28 ` jvdelisle at gcc dot gnu dot org 2008-03-29 4:31 ` jvdelisle at gcc dot gnu 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).