[SciPy-user] scipy.special.erf randomly returns NANs on OSX

Andrea Riciputi ariciputi at pito.com
Tue Jan 24 03:28:09 CST 2006


Yes, I really tried it exactly as shown in the code you wrote. I also  
tried to something like:

double x = 1.0;
for(i = 0; i < 10000; i++) {
   x -= i * DBL_EPSILON;
   y = erf(x);
   print("erf(%.20f) = %e\n", x, y);
}

and the results are absolutely stable and correct. All the tests I  
made passed both with gcc 3.3 and 4.0.

HTH,
  Andrea

On Jan 23, 2006, at 14:24 , Evan Monroig wrote:

> Did you really try the *almost 1.0 but not 1.0* number ? It should be
> something like the following:
>
> double x = 0.0;
> for (int i = 0; i < 10; ++i) {
>     x += 0.1;
> }
> result = erf(x);
> ...



More information about the SciPy-user mailing list