Earlier quoted context omitted.
Ideally the compiler should be able to do this by itself though, at least with the appropriate flag to enable it.
FMA isn't a safe optimization as it can give different results. C++ compilers have flags to enable it globally. gcc and clang include the optimization in -Ofast. Rust allows you to choose at a code level (but usually people don't know about it). Perhaps it should also have a global fast-math flag that would automatically optimize it. Pros and cons to that.
GCC emits FMA instructions at -O2 without -ffast-math.