floating point inconsistency

Vincent Lefevre vincent+gcc@vinc17.org
Wed Feb 17 14:28:00 GMT 2010

On 2010-02-16 15:39:31 +0100, Christoph Groth wrote:
> Thank you all very much for clarifying this issue.  I am very much
> surprised that x87 instructions behave differently on AMD and Intel
> processors but this seems indeed to be the case.

That's for elementary functions only (e.g. fsincos here). On


you can see that different platforms give different results.
Differencies may be due to the OS, the C library and/or the

Note that on x86_64 machines, sin and cos are correctly rounded
(this is not proved, but probably true in practice, assuming no
bugs in the implementation). I wonder why GCC doesn't use these
functions by default instead of glibc's sincos (which could be
enabled only with an option like -ffast-math).

Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

More information about the Gcc-help mailing list