On 02/16/2010 12:47 PM, Christoph Groth wrote: > Cedric Roux <cedric.roux@xxxxxxxxxx> writes: > >> Andrew Haley wrote: >>> That is strange. A bit of debugging would be required to understand >>> why that happens. >> >> (...) >> >> The least significant bit differs. > > Now the question remains whether this is a bug in gcc or not. > > The document http://www.validlab.com/goldberg/paper.ps (Numerical > computation guide) linked from http://gcc.gnu.org/bugs/ states > > " > Many programmers may not realize that even a program that uses only the numeric > formats and operations prescribed by the IEEE standard can compute different > results on different systems." > > Are AMD and Intel x86-64 processors different systems? They don't have different floating-point instruction sets. However, it is possible that this program is calling the x87 fsincos instruction, and it is possible that some AMD and Intel processors give different results. I'm sure that neither Intel nor AMD guarantee perfect LSB accuracy for fsincos. We need to see the assembly code to know for sure. Andrew.