
Beware of Fast-Math
created: May 31, 2025, 7:05 a.m. | updated: June 1, 2025, 3:55 a.m.
One of my more frequent rants, both online and in person, is the danger posed by the "fast-math" compiler flag.
I mean, the whole point of fast-math is trading off speed with correctness.
If fast-math was to give always the correct results, it wouldn’t be fast-math, it would be the standard way of doing math.
Certain algorithms however depend very strictly on the order in which floating point operations are performed.
Well this is referring to one of those slightly annoying edge cases of floating point numbers, subnormals (sometimes called denormals).
1 week, 1 day ago: Hacker News