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

Evan Monroig evan.monroig at gmail.com
Mon Jan 23 07:24:07 CST 2006


On Jan.23 09h20, Andrea Riciputi wrote :
> 
> Even the code proposed by Robert Kern (when translated in C) works  
> correctly:
> 
> > Totila:~/Documents/Dottorato/Codice/prova andrea$ ./erf2
> > erf(1.900000) = 9.927904e-01

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);
...
 
> So I don't think it's a problem with Apple erf implementation. Which  
> OS X version are you running? Which compiler did you used to compile  
> numpy and scipy?

Sorry I don't have OSX at hand, but I know it is Tiger, and I am sure 
I used gcc 3.

Evan



More information about the SciPy-user mailing list