[Bug math/13942] New: x86 acos inaccurate near 1
jsm28 at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Tue Apr 3 19:25:00 GMT 2012
http://sourceware.org/bugzilla/show_bug.cgi?id=13942
Bug #: 13942
Summary: x86 acos inaccurate near 1
Product: glibc
Version: 2.15
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: unassigned@sourceware.org
ReportedBy: jsm28@gcc.gnu.org
Classification: Unclassified
http://sourceware.org/ml/libc-help/2008-09/msg00031.html (mentioned in a recent
bug) reports an issue with acos on x86 being inaccurate near 1 because of using
sqrt (1 - x*x). This is still present with current sources, as illustrated by
the test:
#include <math.h>
#include <stdio.h>
volatile double d = 0x0.ffffffff8p0;
int
main (void)
{
volatile double r = acos (d);
printf ("%.14a\n", r);
return 0;
}
This prints 0x1.000000002aaab0p-16 when an accurate result computed by GNU MPFR
is 0x1.000000000aaab0p-16.
It looks like this issue will affect x86 acos and acosl and x86_64 acosl. For
acosf the squaring (in x87 64-bit precision) will always be exact so there is
no problem. For asin functions and for acos functions near -1 I don't think
there will be significant loss of accuracy from this issue (the result will be
near pi/2 or pi and the problem is for results near 0) but probably all the
functions (other than asinf/acosf) should be fixed and tests added to the
testsuite for all these cases.
--
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.
More information about the Glibc-bugs
mailing list