-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Labels
enhancementnew feature requests (or implementation)new feature requests (or implementation)
Milestone
Description
Spherical Bessel functions of the first kind are defined as,
from mpmath import mpf, sqrt, pi, besselj
def sph_jn(n, z):
return besselj(n + mpf(1)/2, z)*sqrt(pi/(2*z))
For positive integer n, these functions have closed-form expressions in terms of trigonometric functions. For example, sph_jn(0, x) = sin(x)/x (see http://dlmf.nist.gov/10.49.E3).
For negative values of x, the mpmath implementation of these functions has the wrong sign. For example,
>>> sph_jn(0, -1)
mpc(real='-0.84147098480789639', imag='0.0')
The magnitude is correct, but the sign is not!
EDIT: The same problem plagues spherical Bessel functions of the second kind, defined analogously in terms of bessely.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementnew feature requests (or implementation)new feature requests (or implementation)