Enable GCC -Ofast to pass the tests by using !isnan(x) instead of x == x