I wish -ffast-math had been named -fwrong-math. It is the flag that says ‘I accept results that are not compliant with IEEE 754 and I hope that this will make things faster’. The ‘fast’ bit is less certain than the ‘wrong’ bit. Naming it -fwrong-math would communicate that a lot more clearly: don’t enable this unless you’re willing to deal with the consequences of incorrect results. Naming it -ffast-math doesn’t convey this and just makes people think ‘why would I ever want slow maths?’

There is nothing correct or incorrect about IEEE 754 or any other competing floating point implementation, nor there is such a thing as an intrinsically incorrect result. There are only mechanisms which implement different abstractions that come with different engineering tradeoffs and any choice can only be judged on its extrinsic merit in respect to how well it solves a particular solution, and not on any other intrinsic merit.

That said, the likelihood of -ffast-math being appropriate for an arbitrary application is pretty low, and the likelihood that the engineering effort required to analyze whether -ffast-math is appropriate for an application or not is likely to exceed any potential gains from using -ffast-math.

I wish

`-ffast-math`

had been named`-fwrong-math`

. It is the flag that says ‘I accept results that are not compliant with IEEE 754 and I hope that this will make things faster’. The ‘fast’ bit is less certain than the ‘wrong’ bit. Naming it`-fwrong-math`

would communicate that a lot more clearly: don’t enable this unless you’re willing to deal with the consequences of incorrect results. Naming it`-ffast-math`

doesn’t convey this and just makes people think ‘why would I ever want slow maths?’There is nothing

correctorincorrectabout IEEE 754 or any other competing floating point implementation, nor there is such a thing as an intrinsicallyincorrectresult. There are only mechanisms which implement different abstractions that come with different engineering tradeoffs and any choice can only be judged on its extrinsic merit in respect to how well it solves a particular solution, and not on any other intrinsic merit.That said, the likelihood of

`-ffast-math`

being appropriate for an arbitrary application is pretty low, and the likelihood that the engineering effort required to analyze whether`-ffast-math`

is appropriate for an application or not is likely to exceed any potential gains from using`-ffast-math`

.depends on what you are doing with the numerics