Skip to content

Commit

Permalink
BUG: special: fix derivative of spherical_jn(1, 0)
Browse files Browse the repository at this point in the history
Closes gh-8184.
  • Loading branch information
person142 committed Nov 22, 2017
1 parent 52ca231 commit 8344239
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scipy/special/_spherical_bessel.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,13 @@ cdef inline double spherical_jn_d_real(long n, double x) nogil:
return -spherical_jn_real(1, x)
else:
if x == 0:
return 0
# DLMF 10.51.2 doesn't work, so use 10.51.1 to get the
# exact value
if n == 1:
return 1.0/3
else:
return 0
# DLMF 10.51.2
return (spherical_jn_real(n - 1, x) -
(n + 1)*spherical_jn_real(n, x)/x)

Expand Down

0 comments on commit 8344239

Please sign in to comment.