Skip to content

Commit

Permalink
functions: correct BesselBase._eval_expand_func() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jun 2, 2021
1 parent b7cbfcf commit 7fe2706
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion diofant/functions/special/bessel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _eval_conjugate(self):

def _eval_expand_func(self, **hints):
nu, z, f = self.order, self.argument, self.__class__
if nu.is_extended_real:
if nu.is_real:
if (nu - 1).is_positive:
return (-self._a*self._b*f(nu - 2, z)._eval_expand_func() +
2*self._a*(nu - 1)*f(nu - 1, z)._eval_expand_func()/z)
Expand Down
4 changes: 4 additions & 0 deletions diofant/tests/functions/test_bessel.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ def check(eq, ans):
assert besselx(i, x).is_extended_real is None
assert besselx(x, z).is_extended_real is None

# issue sympy/sympy#21486
assert expand_func(besselx(oo, x)) == besselx(oo, x, evaluate=False)
assert expand_func(besselx(-oo, x)) == besselx(-oo, x, evaluate=False)

for besselx in [besselj, besseli]:
assert besselx(i, r).is_extended_real
for besselx in [bessely, besselk]:
Expand Down
1 change: 1 addition & 0 deletions docs/release/notes-0.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ These Sympy issues also were addressed:
* :sympyissue:`21460`: Polynomial GCD result is different for dense trivial polynomial
* :sympyissue:`21466`: Regression for match for differential binomial expression
* :sympyissue:`21166`: Wrong integration result involving square root of absolute value
* :sympyissue:`21486`: expand_func(besselj(oo, x)) -> RecursionError

0 comments on commit 7fe2706

Please sign in to comment.