Comment #10 on issue 3223 by smi...@gmail.com: degree((x+1)**10000) takes too long
http://code.google.com/p/sympy/issues/detail?id=3223

Here's a more explicit example of what I showed above:

def deg(e, s):
...  try:
...   return -e.subs(x,1/x).leadterm(x)[1]
...  except:
... return e.subs(x, 1/x).as_leading_term(x).subs(x, 1/x).as_base_exp()[1]/s.as_base_exp()[1]
...
deg(exp(x)**2+2*exp(x)+x, exp(x))
2
deg(x**2+3*x, x)
2
deg(4*x**3 - x**2+3*x, x)
3

But if you enter a "non-generator" the answer is not what you are probably looking for:

deg(exp(x)**2+2*exp(x)+x, x**2)
x


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to