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”…?
Answer: no.
Confirmed. It’s one of the things I know I can look up when I suspect I need it.
The problem is not knowing that there is even something that needs to be looked up.
Even basic things like “no, not all base-10 numbers have exact (finite) base-2 representations”, to “yes, signed zero is a thing, for very good reasons” to “please don’t forget that Inf, -Inf, and NaN are valid (and useful) values”.
One of the design aims of IEEE floating-point was to reduce the likelihood of developers, who did not know much about floating-point, producing incorrect results.
The survey asks a load of detailed questions that only a few people who have studied the subject in detail will be able to answer. Surprise! The results were little better than random.
I’m sure I could come up with a survey to find out whether developers understood integer arithmetic, and get essentially random results.
Darn. You beat me to posting exactly the same thing.