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; 11+ 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] 11+ messages in thread
[parent not found: <bug-1163-131@http.sourceware.org/bugzilla/>]
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
@ 2012-02-22 21:53 ` jsm28 at gcc dot gnu.org
2012-06-22 18:08 ` liubov.dmitrieva at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-22 21:53 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|SUSPENDED |NEW
AssignedTo|aj at suse dot de |unassigned at sourceware
| |dot org
--- Comment #4 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-22 21:53:08 UTC ---
Still present, should be added to the testsuite.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
2012-02-22 21:53 ` jsm28 at gcc dot gnu.org
@ 2012-06-22 18:08 ` liubov.dmitrieva at gmail dot com
2012-06-22 18:59 ` joseph at codesourcery dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: liubov.dmitrieva at gmail dot com @ 2012-06-22 18:08 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |liubov.dmitrieva at gmail
| |dot com
--- Comment #5 from Liubov Dmitrieva <liubov.dmitrieva at gmail dot com> 2012-06-22 18:08:04 UTC ---
There are many inputs give results that are wrong by more than 1 ulp for sinf()
in sysdeps/ieee754/flt-32, and for cosf - also...
I unintentionally attached my data to another tracker:
http://sourceware.org/bugzilla/show_bug.cgi?id=5997
Summary is: Intel proprietary test system observed ~1.4 ulp errors on usual
arguments, and observed total loss of accuracy on |x| > 1e30 for current glibc
routines which use the flt-32 C implementations
I've submitted a patch proposed new implementation which solves the issue for
all architectures with SSE2 support and significantly improves performance.
http://sourceware.org/ml/libc-alpha/2012-06/msg00624.html
I intend submit a patch with x86_64 Sse2 implementation of sinf and cosf as
well.
New Asm versions, provided by Intel, are maximum 0.500121 ulp for sinf,
0.500573 ulp for cosf.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
2012-02-22 21:53 ` jsm28 at gcc dot gnu.org
2012-06-22 18:08 ` liubov.dmitrieva at gmail dot com
@ 2012-06-22 18:59 ` joseph at codesourcery dot com
2012-06-22 19:54 ` joseph at codesourcery dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2012-06-22 18:59 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-06-22 18:58:55 UTC ---
On Fri, 22 Jun 2012, liubov.dmitrieva at gmail dot com wrote:
> I unintentionally attached my data to another tracker:
> http://sourceware.org/bugzilla/show_bug.cgi?id=5997
>
> Summary is: Intel proprietary test system observed ~1.4 ulp errors on usual
> arguments, and observed total loss of accuracy on |x| > 1e30 for current glibc
> routines which use the flt-32 C implementations
Do those total-loss-of-accuracy failures appear on x86_64? If not, then
you should file a new bug and put the data in that bug, rather than using
this one, which is about x86_64 not 32-bit x86.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2012-06-22 18:59 ` joseph at codesourcery dot com
@ 2012-06-22 19:54 ` joseph at codesourcery dot com
2012-06-22 20:45 ` joseph at codesourcery dot com
2012-10-24 12:44 ` jsm28 at gcc dot gnu.org
5 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2012-06-22 19:54 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
--- Comment #7 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-06-22 19:54:04 UTC ---
On Fri, 22 Jun 2012, joseph at codesourcery dot com wrote:
> Do those total-loss-of-accuracy failures appear on x86_64? If not, then
> you should file a new bug and put the data in that bug, rather than using
> this one, which is about x86_64 not 32-bit x86.
I can reproduce problems on x86_64, although with different bad results
from x86. But, you should still file a *new* bug for these problems,
since it seems quite clear that the range-reduction-accuracy problems can
sensibly be fixed separately from the not-correctly-rounded issues this
bug is about. In general, unless it is clear that two issues can only
sensibly be fixed together, they should have *separate* bugs filed; always
err on the side of filing duplicate bugs rather than confusing an existing
bug with something that might not be fixed together with the originally
reported issue.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
` (3 preceding siblings ...)
2012-06-22 19:54 ` joseph at codesourcery dot com
@ 2012-06-22 20:45 ` joseph at codesourcery dot com
2012-10-24 12:44 ` jsm28 at gcc dot gnu.org
5 siblings, 0 replies; 11+ messages in thread
From: joseph at codesourcery dot com @ 2012-06-22 20:45 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
--- Comment #8 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-06-22 20:45:15 UTC ---
I've filed bug 14283 for the cases of large errors. Please keep this bug
for the matter of results that, although not correctly rounded, are within
the general range (< 10 ulp) of errors recorded in libm-test-ulps files.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug math/1163] sinf inaccurate for some inputs
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
` (4 preceding siblings ...)
2012-06-22 20:45 ` joseph at codesourcery dot com
@ 2012-10-24 12:44 ` jsm28 at gcc dot gnu.org
5 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-10-24 12:44 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1163
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
--- Comment #9 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-10-24 12:43:43 UTC ---
Collecting all reports of few-ulps errors together in one meta-bug.
*** This bug has been marked as a duplicate of bug 14759 ***
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-10-24 12:44 UTC | newest]
Thread overview: 11+ 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
[not found] <bug-1163-131@http.sourceware.org/bugzilla/>
2012-02-22 21:53 ` jsm28 at gcc dot gnu.org
2012-06-22 18:08 ` liubov.dmitrieva at gmail dot com
2012-06-22 18:59 ` joseph at codesourcery dot com
2012-06-22 19:54 ` joseph at codesourcery dot com
2012-06-22 20:45 ` joseph at codesourcery dot com
2012-10-24 12:44 ` jsm28 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).