[Scipy-tickets] [SciPy] #1640: sph_jn returns false results for some orders/values

SciPy Trac scipy-tickets@scipy....
Fri Apr 6 14:22:30 CDT 2012


#1640: sph_jn returns false results for some orders/values
---------------------------+------------------------------------------------
 Reporter:  Anakinele      |       Owner:  pv         
     Type:  defect         |      Status:  new        
 Priority:  high           |   Milestone:  Unscheduled
Component:  scipy.special  |     Version:  0.9.0      
 Keywords:  sph_jn         |  
---------------------------+------------------------------------------------
Description changed by warren.weckesser:

Old description:

> The sph_jn function tends to +/- Inf for values above a threshold.
>
> For example with order n=2 (copy-past from IPython):
>
> In [1]: sph_jn(2,3350.506)
> Out[1]:
> (array([  2.98461400e-04,  -6.76491641e-07,  -2.98462005e-04]),
>  array([  6.76491641e-07,   2.98461803e-04,  -4.09252598e-07]))
>
> In [2]: sph_jn(2,3350.507)
> Out[2]:
> (array([             inf,  -3.78029638e-07,             -inf]),
>  array([  3.78029638e-07,              inf,              inf]))
>
> Here, there are anomalous 'jump' between 3350.506 and 3350.507 for some
> orders and some derivatives.
>
> As a point of comparison, Mathematica
> (http://www.wolframalpha.com/input/?i=SpericalBesselJ[2%2C3350.507])
> says:
> SpericalBesselJ[2,3350.507] ~= -0.000298462...

New description:

 The sph_jn function tends to +/- Inf for values above a threshold.

 For example with order n=2 (copy-past from IPython):
 {{{
 In [1]: sph_jn(2,3350.506)
 Out[1]:
 (array([  2.98461400e-04,  -6.76491641e-07,  -2.98462005e-04]),
  array([  6.76491641e-07,   2.98461803e-04,  -4.09252598e-07]))

 In [2]: sph_jn(2,3350.507)
 Out[2]:
 (array([             inf,  -3.78029638e-07,             -inf]),
  array([  3.78029638e-07,              inf,              inf]))
 }}}
 Here, there are anomalous 'jump' between 3350.506 and 3350.507 for some
 orders and some derivatives.

 As a point of comparison, Mathematica
 (http://www.wolframalpha.com/input/?i=SpericalBesselJ[2%2C3350.507]) says:
 SpericalBesselJ[2,3350.507] ~= -0.000298462...

--

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


More information about the Scipy-tickets mailing list