This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/13942] x86 acos inaccurate near 1


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]