logoalt Hacker News

AlotOfReadingyesterday at 7:11 PM1 replyview on HN

Your compiler does many optimizations that break numerical reproducibility, especially in floats. I reviewed a PR the other day that wrote X=AB+(CD)+E;

And when I checked 3 different compilers, each of them chose a different way to use FMAs.

Even with integer math, you can get different numerical results via UB (e.g. expressions with signed overflow one way and not another).


Replies

daemintoday at 2:00 AM

Floating point reproducibility and cross platform determinism requires strict adherence to the IEEE standard and disabling of fused instructions.

show 1 reply