3 ms·
They don't necessarily produce the same result and strict IEEE conformance prohibits such transformations. With GCC, --ffast-math enables optimizations like thi
by kevin_thibedeau 6y ago
They don't necessarily produce the same result and strict IEEE conformance prohibits such transformations. With GCC, --ffast-math enables optimizations like this.
- lamontcg 6y agoThat makes sense. I typically have to worry about larger relative tolerances anyway so I think I can start using that trick.
- SuchAnonMuchWow 6y agoIn this specific example, they do produce exactly the same result: `a / b` is completely equivalent to `a * (1 / b)` when both b and 1/b are perfectly representable in floating point without rounding, which is the case for 2 and 0.5