public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/1161] New: powf inaccurate for some inputs
@ 2005-08-03 17:31 bob dot wilson at acm dot org
2005-10-15 23:47 ` [Bug math/1161] " drepper at redhat dot com
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: bob dot wilson at acm dot org @ 2005-08-03 17:31 UTC (permalink / raw)
To: glibc-bugs
The version of powf() in sysdeps/ieee754/flt-32/e_powf.c gives results that are wrong by more than 1
ulp for at least some inputs. The testcase below will demonstrate the problem for powf(-1.100000e
+00, 1.010000e+02). The output from this test on an x86_64 platform running RH Enterprise 3 is:
inputs: a = -1.100000e+00 b = 1.010000e+02
actual = -1.5158703e+04 (0xc66cdad0)
expected = -1.5158707e+04 (0xc66cdad4)
pow(a, b) = -1.5158706757936e+04
The actual value is off by 4 ulp from the expected value, so the absolute error must be at least 3 ulp.
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 = 0xBF8CCCCD;
unsigned int tb = 0x42CA0000;
main ()
{
float a = *(float *)&ta;
float b = *(float *)&tb;
float c = powf(a, b);
float d = pow(a, b);
printf("inputs: a = %e b = %e\n", a, b);
printf("actual =\t%.7e\t(0x%08x)\n", c, *(unsigned *)&c);
printf("expected =\t%.7e\t(0x%08x)\n", d, *(unsigned *)&d);
printf("pow(a, b) =\t%.13e\n", pow(a, b));
}
--
Summary: powf 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=1161
------- 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] 6+ messages in thread
* [Bug math/1161] powf inaccurate for some inputs
2005-08-03 17:31 [Bug math/1161] New: powf inaccurate for some inputs bob dot wilson at acm dot org
@ 2005-10-15 23:47 ` drepper at redhat dot com
2009-09-24 8:03 ` vincent+libc at vinc17 dot org
2009-09-24 8:12 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 6+ 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
Status|NEW |SUSPENDED
http://sourceware.org/bugzilla/show_bug.cgi?id=1161
------- 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] 6+ messages in thread
* [Bug math/1161] powf inaccurate for some inputs
2005-08-03 17:31 [Bug math/1161] New: powf inaccurate for some inputs bob dot wilson at acm dot org
2005-10-15 23:47 ` [Bug math/1161] " drepper at redhat dot com
@ 2009-09-24 8:03 ` vincent+libc at vinc17 dot org
2009-09-24 8:12 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 6+ messages in thread
From: vincent+libc at vinc17 dot org @ 2009-09-24 8:03 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2009-09-24 08:03 -------
FYI, this is similar to bug 706 (on pow() inaccuracies, which are particularly
visible for x ~ 1.0).
--
http://sourceware.org/bugzilla/show_bug.cgi?id=1161
------- 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] 6+ messages in thread
* [Bug math/1161] powf inaccurate for some inputs
2005-08-03 17:31 [Bug math/1161] New: powf inaccurate for some inputs bob dot wilson at acm dot org
2005-10-15 23:47 ` [Bug math/1161] " drepper at redhat dot com
2009-09-24 8:03 ` vincent+libc at vinc17 dot org
@ 2009-09-24 8:12 ` vincent+libc at vinc17 dot org
2 siblings, 0 replies; 6+ messages in thread
From: vincent+libc at vinc17 dot org @ 2009-09-24 8:12 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2009-09-24 08:12 -------
*** Bug 3407 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |myles at peakstreaminc dot
| |com
http://sourceware.org/bugzilla/show_bug.cgi?id=1161
------- 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] 6+ messages in thread
* [Bug math/1161] powf inaccurate for some inputs
[not found] <bug-1161-131@http.sourceware.org/bugzilla/>
2012-02-22 21:49 ` jsm28 at gcc dot gnu.org
@ 2012-10-24 12:42 ` jsm28 at gcc dot gnu.org
1 sibling, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-10-24 12:42 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1161
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
--- Comment #5 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-10-24 12:42:06 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] 6+ messages in thread
* [Bug math/1161] powf inaccurate for some inputs
[not found] <bug-1161-131@http.sourceware.org/bugzilla/>
@ 2012-02-22 21:49 ` jsm28 at gcc dot gnu.org
2012-10-24 12:42 ` jsm28 at gcc dot gnu.org
1 sibling, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-22 21:49 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=1161
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:48:24 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] 6+ messages in thread
end of thread, other threads:[~2012-10-24 12:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03 17:31 [Bug math/1161] New: powf inaccurate for some inputs bob dot wilson at acm dot org
2005-10-15 23:47 ` [Bug math/1161] " drepper at redhat dot com
2009-09-24 8:03 ` vincent+libc at vinc17 dot org
2009-09-24 8:12 ` vincent+libc at vinc17 dot org
[not found] <bug-1161-131@http.sourceware.org/bugzilla/>
2012-02-22 21:49 ` jsm28 at gcc dot gnu.org
2012-10-24 12:42 ` 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).