[SciPy-Dev] PR adding vectorized spherical Bessel functions
Ted Pudlik
tpudlik at gmail.com
Thu Dec 31 13:19:47 EST 2015
Hello,
I started a pull request <https://github.com/scipy/scipy/pull/5623>
providing vectorized implementations of four spherical Bessel functions
(jn, yn, in, kn) and their derivatives. This is my first large pull
requests, so I would be grateful for any comments!
Highlights:
1. Speedup of about an order of magnitude relative to `np.vectorize`
(generally more, except for jn for real argument).
2. Recursion largely replaced with the relationship to cylindrical
Bessel functions <http://dlmf.nist.gov/10.47.ii>, which resolves
accuracy issues for large argument (see gh-1641
<https://github.com/scipy/scipy/issues/1641>, gh-2165
<https://github.com/scipy/scipy/issues/2165> for jn at large real
argument, but similar problems existed for yn and kn at large complex
argument).
3. More careful treatment of 0, infinity, and overflow. (E.g.,
sph_kn(125, 0.1) = inf, not 0; yn(5, 0) = -inf, not -10**300.)
Best wishes,
Ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20151231/4a73434b/attachment.html>
More information about the SciPy-Dev
mailing list