Sine and Cosine Accuracy
Menezes, Evandro
evandro.menezes@amd.com
Fri May 27 00:54:00 GMT 2005
Scott,
> > This is not true. Compare results on an x86 systems with
> those on an
> > x86_64 or ppc. As I said before, shortcuts were taken in x87 that
> > sacrificed accuracy for the sake of speed initially and later of
> > compatibility.
>
> It *is* true for the case where the argument is in the range
> [0, 2*PI), at least according to the tests I published
> earlier in this thread. If you think there is something
> erroneous in the test code, I sincerely would like to know.
Your code just tests every 3.6°, perhaps you won't trip at the problems...
As I said, x87 can be off by hundreds of ulps, whereas the routines for x86_64 which ships with SUSE are accurate to less than 1ulp over their entire domain.
Besides, you're also comparing 80-bit calculations with 64-bit calculations, not only the accuracy of sin and cos. Try using -ffloat-store along with -mfpmath=387 and see yet another set of results. At the end of the day, which one do you trust? I wouldn't trust my check balance to x87 microcode... ;-)
HTH
_______________________________________________________
Evandro Menezes Software Strategy & Alliance
512-602-9940 AMD
evandro.menezes@amd.com Austin, TX
More information about the Gcc
mailing list