Is it better to be slowly correct all the time, or quickly incorrect some of the time?
Really, I would suggest not giving advice like “turn on -ffast-math and friends” unless you really understand what those flags are doing to your code.
There is an awful lot of numerical analysis that depends on the surprisingly complex behavior of floating-point complex arithmetic. That complex-multiplication function is written that way for a reason. Many reasons, actually.
Perhaps that warrants a little more investigation beyond “LOL the standard library authors are just a bunch of pedants”…?
You should probably know that -ffast-math turns on -funsafe-math-optimizations which makes it misbehave with regards to negative zero.
For complex arithmetic, you might run into situations where you do care that negative zero is a negative number, because it may be on a branch cut.
Is it better to be slowly correct all the time, or quickly incorrect some of the time?
Really, I would suggest not giving advice like “turn on
-ffast-math
and friends” unless you really understand what those flags are doing to your code.There is an awful lot of numerical analysis that depends on the surprisingly complex behavior of floating-point complex arithmetic. That complex-multiplication function is written that way for a reason. Many reasons, actually.
Perhaps that warrants a little more investigation beyond “LOL the standard library authors are just a bunch of pedants”…?