0

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

user1332148
  • 1,256
  • 2
  • 11
  • 24
  • I guess the question is, do any of your algorithms rely on NaN or Inf? – Oliver Charlesworth Apr 24 '12 at 22:14
  • Yes, they do rely on NaN/Inf. I expect to have to change that and can since it's my code. Given even that though, what options are there for ensuring stability when finite-math-only is on? – user1332148 Apr 24 '12 at 22:24

0 Answers0