Get the latest tech news
Beware of Fast-Math
One of my more frequent rants, both online and in person, is the danger posed by the "fast-math" compiler flag. While these rants may elicit resigned acknowledgment from those who already understand the dangers involved, they do little to help those who don't.
Fast-math allows the compiler to break some of these rules: these breakages may seem pretty innocuous at first glance, but can have significant and occasionally unfortunate downstream effects. The problem here is that the compiler generally isn't allowed to make this optimization: it requires evaluating the sum in a different association grouping than was specified in the code, and so can give different results[2]. At the more extreme end, you can use SIMD intrinsics: these are commonly used in libraries, often with the help of code generation ( FFTW uses this appraoch), but requires considerably more effort and expertise, and can be difficult to port to new platforms.
Or read this on Hacker News