How does --use_fast_math affect the precision of division operations in CUDA?
I wrote a CUDA kernel where enabling --use_fast_math leads to results that are completely different from the results obtained without --use_fast_math.
I understand that --use_fast_math enables faster but less precise implementations of certain math operations, but I did not expect the numerical difference to be this large, especially for division.
Could someone explain:
- What exactly changes for division (
/) when--use_fast_mathis enabled? - Whether division is replaced by reciprocal-based approximations (e.g.,
rcp) and how many bits of precision are guaranteed? - In what cases the error can become significant?
Any explanation or references would be greatly appreciated. Thank you!