I have a couple audio libraries that I need to scrub so I can turn on -ffinite-math. I know I need to remove the use of NaN and +/-Inf as sentinel values but am unclear how to ensure stability in the code. I am also not sure what kind of floating point comparison tests I can safely make when using -ffinite-math-only. Is it better just to scrap the code and rewrite it?
I know there is not a simple answer so please feel free to post links to any literature that discusses stable floating-point code without the use of sentinel values and/or refactoring floating-point code for speed.
Thanks