[Scipy-tickets] [SciPy] #1142: scipy.stats.norm.isf(1e-17) gives outrageous value

SciPy Trac scipy-tickets@scipy....
Mon Mar 29 11:57:37 CDT 2010

#1142: scipy.stats.norm.isf(1e-17) gives outrageous value
 Reporter:  peridot  |       Owner:  somebody
     Type:  defect   |      Status:  new     
 Priority:  normal   |   Milestone:  0.8.0   
Component:  Other    |     Version:  0.7.0   
 Keywords:           |  
 In [21]: norm.isf(1e-16)
 Out[21]: 8.2095361516013874

 In [20]: norm.isf(1e-17)
 Out[20]: 1.7976931348623157e+308

 I suspect that there's some dodgy subtraction going on, since this is
 about one double epsilon, and ndtri, the raw cephes function, works fine:

 In [22]: -scipy.special.ndtri(1e-17)
 Out[22]: 8.4937932241095986

 In [23]: -scipy.special.ndtri(1e-16)
 Out[23]: 8.2220822161304348

 (Note that 1e-16 is wrong by ~0.5%, which is pretty embarrassing.)

 The subtraction theory is supported by the fact that norm.ppf is fine:

 In [25]: norm.ppf(1e-16)
 Out[25]: -8.2220822161304348

 In [26]: norm.ppf(1e-17)
 Out[26]: -8.4937932241095986

 In other words, norm.isf(x) is almost certainly being converted to

Ticket URL: <http://projects.scipy.org/scipy/ticket/1142>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list