This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13942] x86 acos inaccurate near 1
- From: "joseph at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 04 Apr 2012 14:24:05 +0000
- Subject: [Bug math/13942] x86 acos inaccurate near 1
- Auto-submitted: auto-generated
- References: <bug-13942-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13942
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-04-04 14:24:05 UTC ---
On Wed, 4 Apr 2012, bugdal at aerifal dot cx wrote:
> printf("%.17g\n", (double)atanl(sqrtl(1-(long double)x*x)));
> printf("%.17g\n", (double)atanl(sqrtl((1-(long double)x)*(1+(long
> double)x))));
That's not the formula. It's atan2l (sqrtl (...), x) that the code is
effectively using (and the point is to make what's inside the sqrtl more
accurate).
> Note that our algorithm avoids performing any multiplication or division that
> would lose precision. The only loss of precision takes place at the sqrt
> operations (which will be correctly rounded for extended precision) and the
> atan operation.
Depending on the input, 1+x or 1-x may lose precision as well for the long
double functions such as acosl, but I don't think that loss is
significant for the final result.
--
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.