[Scipy-tickets] [SciPy] #623: scipy.special.jv incorrect for certain argument(s)

SciPy scipy-tickets@scipy....
Wed Apr 16 15:20:27 CDT 2008

#623: scipy.special.jv incorrect for certain argument(s)
 Reporter:  wa03               |        Owner:  cookedm 
     Type:  defect             |       Status:  assigned
 Priority:  high               |    Milestone:  0.7     
Component:  scipy.special      |      Version:          
 Severity:  major              |   Resolution:          
 Keywords:  special.jv bessel  |  
Comment (by wernerg):

 I'd like to add some details about errors I've encountered in special
 in case it helps:

 jn(n,z) is inaccurate for real z>n, n>1 (e.g., jn(199,250.1) and
 jn(9,250.1) both err in the second digit.  Perhaps downward recursion is
 being used for z>n, where upward recursion should be used (according to

 jn_zeros(n,smax)[s] is inaccurate for n=0, s>=269 (assuming s<smax)
 Some errors in jn_zeros may be caused by errors in jn(n,z):
 jn_zeros(101,1)[0] errs in the 8th digit.
 jn_zeros(100,200)[-1] is accurate.
 jn_zeros(100,220)[-1] is accurate.
 jn_zeros(100,225)[-1] errs in the 12th digit.
 jn_zeros(100,240)[-1] errs in the 3rd digit.

 jn_zeros(n,smax) raises an exception for smax >= 102.

 kn(n,z) is inaccurate for n>=35 (seems okay for n<=25, 5<=z<=391,
 though I haven't thoroughly explored this).  kn(0,5.) is off by
 a relative amount about 4e-13, though this may be acceptable.
 (This is an easy function to implement, given k0 and k1, which
 seem to be okay.)

 Also, erf(z) is inaccurate for complex z.  There is an
 algorithm that's easy to implement at a high-level (if using ffts is easy)
 in Table 1 of
 J A C Weideman, "Computation of the Complex Error Function,"
 SIAM J. Numer. Anal. 31 (5) 1497-1518 (1994).

 Greg Werner

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

More information about the Scipy-tickets mailing list