0

I'm working with statistic functions with a lot of float data. I want it to run faster but Ofast disable NAN (fno-finite-math-only flag), which is not allowed in my case.

In this case, is it safe to turn on only associative-math ? I think this flag allows things like vectorized sum of vector array, even if the array contains NAN.

Huy Le
  • 1,439
  • 4
  • 19

1 Answers1

1

From the docs:

NOTE: re-ordering may change the sign of zero as well as ignore NaNs

So if you want correct handling of NaNs, you should not use -fassociative-math.

Thomas
  • 174,939
  • 50
  • 355
  • 478