Skip to content

Commit

Permalink
Merge pull request #204 from skirpichev/fix-omg203
Browse files Browse the repository at this point in the history
Fix #203
  • Loading branch information
skirpichev committed Jan 29, 2016
2 parents b85b872 + 559ccb8 commit 0452cd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sympy/simplify/hyperexpand.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ def __new__(cls, ai, bj):
n = ai - bj
if not n.is_Integer or n < 0:
return
if bj.is_integer and bj <= 0 and bj + n - 1 >= 0:
if bj.is_integer and bj <= 0:
return

expr = Operator.__new__(cls)
Expand Down Expand Up @@ -1706,7 +1706,7 @@ def try_polynomial(func, z):
al0 = [x for x in a0 if x <= 0]
bl0 = [x for x in b0 if x <= 0]

if bl0:
if bl0 and len(al0) <= 1:
return oo
if not al0:
return
Expand Down
7 changes: 7 additions & 0 deletions sympy/simplify/tests/test_hyperexpand.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,3 +1013,10 @@ def test_prudnikov_fail_other():
def test_bug():
h = hyper([-1, 1], [z], -1)
assert hyperexpand(h) == (z + 1)/z


def test_omgissue_203():
h = hyper((-5, -3, -4), (-6, -6), 1)
assert hyperexpand(h) == Rational(1, 30)
h = hyper((-6, -7, -5), (-6, -6), 1)
assert hyperexpand(h) == -Rational(1, 6)

0 comments on commit 0452cd8

Please sign in to comment.