News for hackers. Stuff that matters.
Re:GCC optimized code gives strange floating point results by tbirdz on Sunday February 26, 2017 @05:37PM (#13740429)
In practice, I don't think IEEE 754 floating point is deterministic, especially not across multiple ISAs, multiple vendors of the same ISA (Intel, AMD), different generations of the same vendor's cpus, different compilers and different math libraries, even just C's libm.

So just a warning to everyone out there: unless you are very, very careful your floating point code will not be deterministic. If you thought you can just use floats and expect it to "just work" the same, then you're out of luck.

Here's a couple of articles which go into more detail about problems with floating point determinism:

http://gafferongames.com/networking-for-game-programmers/flo...

https://randomascii.wordpress.com/2013/07/16/floating-point-...

Re:GCC optimized code gives strange floating point results by gpderetta on Monday February 27, 2017 @08:41AM (#13744034)
As long as the unit is IEE754, results are expected to be exact to the last ulp [1]. There might be issues in the lowering of high level languages to low level assemblers, but that's a different story (i.e the implementation is not IEE754 compliant).

[1] transcendental functions IIRC are not required to be exact to the full precision and historically they aren't. But there are (portable) math libraries that guarantee full precision.