Skip to content

Commit

Permalink
use subs instead of xreplace
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed May 17, 2024
1 parent 1bd87b7 commit 5af6e4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions integration_tests/gruntz_demo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def rewrite(e, x, w):
if x in Omega:
# Moving up in the asymptotical scale:
with evaluate(False):
e = e.xreplace({x: exp(x)})
Omega = {s.xreplace({x: exp(x)}) for s in Omega}
e = e.subs(x, exp(x))
Omega = {s.subs(x, exp(x)) for s in Omega}

Omega = list(ordered(Omega, keys=lambda a: -len(mrv(a, x))))

Expand All @@ -225,7 +225,7 @@ def rewrite(e, x, w):
c = limitinf(a.exp/g.exp, x)
b = exp(a.exp - c*g.exp)*w**c # exponential must never be expanded here
with evaluate(False):
e = e.xreplace({a: b})
e = e.subs(a, b)

return e

Expand Down

0 comments on commit 5af6e4a

Please sign in to comment.