News for hackers. Stuff that matters.
Re:GNU GCC does not round floating-point divisions to the ne... by bonzini on Saturday June 27, 2020 @10:11PM (#23666293)
Stuff like Kahan summation breaks horribly with -ffast-math, because if you assume that sum is associative the error term, which is ((s+x)-s)-x, simplifies to zero.

https://en.m.wikipedia.org/wiki/Kahan_summation_algorithm

Re:GNU GCC does not round floating-point divisions to the ne... by all-fakes on Saturday June 27, 2020 @10:13PM (#23666301)
Yeah, that's the obvious counterexample, but that's why I said "more often than not". The statement I was questioning was that fast-math is "normally not more correct."
Re:GNU GCC does not round floating-point divisions to the ne... by kevin_thibedeau on Saturday June 27, 2020 @11:39PM (#23666591)
That's where you dust off volatile.
Re:GNU GCC does not round floating-point divisions to the ne... by nestorD on Sunday June 28, 2020 @07:50AM (#23668173)
Sadly true. That's the only portable way I found to implement something akind to a Kahan sum so that no compiler / flag would destroy it.