Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Nov 29, 2017
1 parent c7d05b4 commit c06d99f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions diofant/core/tests/test_expr.py
Expand Up @@ -1619,3 +1619,25 @@ def test_sympyissue_7426():
def test_pow_rewrite():
assert (2**x).rewrite(sin) == 2**x
assert (2**x).rewrite(tanh) == 2**x


def test_sympyissue_13645():
r, r_m = symbols('r r_m', positive=True)
th = symbols('th', extended_real=True)
a, M = symbols('a M', extended_real=True)
kappa, gamma = symbols('kappa gamma', extended_real=True)

l = sqrt(M/r_m**3)*(r_m**4 + r_m**2*a**2 - 2*M*r_m*a**2 -
a*sqrt(M*r_m)*(r_m**2-a**2))
l /= r_m**2 - 3*M*r_m + 2*a*sqrt(M*r_m)

Delta = r**2 - 2*M*r + a**2
Sigma = r**2 + a**2*cos(th)**2
A = (r**2 + a**2)**2 - Delta*a**2*sin(th)**2

tmp3 = sqrt(1 + l**2*Sigma**2*Delta/(sin(th))**2)
ln_h = log((1 + tmp3) / (Sigma*Delta/A)) - tmp3
hm1 = exp(ln_h) - 1

# not hangs
(hm1*(gamma-1)/(kappa*gamma))**(1/(gamma - 1))
1 change: 1 addition & 0 deletions docs/release/notes-0.9.rst
Expand Up @@ -178,3 +178,4 @@ These Sympy issues also were addressed:
* :sympyissue:`13071` meijerg.is_number is wrong
* :sympyissue:`13575` limit(acos(erfi(x)), x, 1) causes recursion error
* :sympyissue:`13629` bug in rsolve
* :sympyissue:`13645` sympy hangs on evaluating expression

0 comments on commit c06d99f

Please sign in to comment.