Why is -freciprocal-math unsafe in GCC?

c, compiler-construction, gcc, math, precision

Solution

Dividing by 10 and multiplying by 0.1000000000000000055511151231257827021181583404541015625 are not the same thing.

Problem

`-freciprocal-math` in GCC changes the following code ``` double a = b / c; ``` to ``` double tmp = 1/c; double a = b * tmp; ``` In GCC manual, it's said that such an optimization is unsafe and is not sticked to IEEE standards. But I cannot think of an example. Could you give an example about this?

Original source