Correct implementation of spherical bessel functions (#992)
Closes #991
This commit is contained in:
@@ -218,7 +218,7 @@ def spherical_jn(ctx, n, z):
|
||||
mpf('0.84147098480789639')
|
||||
|
||||
"""
|
||||
return ctx.besselj(n + ctx.one/2, z) * ctx.sqrt(ctx.pi/2*z)
|
||||
return ctx.besselj(n + ctx.one/2, z) * ctx.sqrt(ctx.pi/(2*z))
|
||||
|
||||
@defun
|
||||
def spherical_yn(ctx, n, z):
|
||||
@@ -240,7 +240,7 @@ def spherical_yn(ctx, n, z):
|
||||
mpf('-0.54030230586813965')
|
||||
|
||||
"""
|
||||
return ctx.bessely(n + ctx.one/2, z) * ctx.sqrt(ctx.pi/2*z)
|
||||
return ctx.bessely(n + ctx.one/2, z) * ctx.sqrt(ctx.pi/(2*z))
|
||||
|
||||
@defun_wrapped
|
||||
def whitm(ctx,k,m,z,**kwargs):
|
||||
|
||||
@@ -2454,3 +2454,7 @@ def test_issue_908():
|
||||
def test_issue_637():
|
||||
assert hankel1(1, 1 + 30j).ae(-7.25495e-15 - 1.17346e-14j)
|
||||
assert hankel2(1, 1 - 30j).ae(-7.25495e-15 + 1.17346e-14j)
|
||||
|
||||
def test_issue_991():
|
||||
assert spherical_jn(0, 1.3).ae(0.74119860416707)
|
||||
assert spherical_yn(0, 1.3).ae(-0.20576832971122)
|
||||
|
||||
Reference in New Issue
Block a user