Christopher Smith
Christopher Smith
It is possible to obtain a quick upper estimate of the degree (and sometimes that might be good enough). Here is the code and a test expression (in compressed form):...
These have been lightly tested and are here for reference: ``` def nominal_degree(p, v): """Return the coefficient and power of the highest power appear in p. If terms of the...
I am really happy with the performance of these, @asmeurer degree and leadterm could act as functions which wrap the behavior of Poly.degree and Expr.leadterm.
> Handling large or symbolic powers in polynomials is a major problem in general. One thing that can be done at the `solve/expr` level is to have an option to...
With something like `cse` it seems like it would be nice to be able to pass a "SymPy known object" and get the same back, perhaps with subexpressions replaced with...
``` This factored expression should not become unfactored, either: >>> eq sqrt(a/(a + b)**2) >>> factor(eq) sqrt(a/(a**2 + 2*a*b + b**2)) ``` Original comment: http://code.google.com/p/sympy/issues/detail?id=3594#c3 Original author: https://code.google.com/u/117933771799683895267/
This should be looked at carefully to see what other routines use Wilds in a way that may need to be overridden (like the new collect behavior) to see that...
should we have a totally different method, has_pattern()? I think a lot of code would be very surprised by the pattern matching behavior of has. e.g. if you had an...
This now gives ```python >>> [i.has(Wild('x')) for i in [S(1),x,Wild('x')]] [False, False, True] ``` A test can close this issue.
``` here is an example involving powers: >>> eq (-sqrt(x) + 1)**4*(sqrt(x) + 1)**(3/2)/(-x + 1)**3 >>> cancel(_) (-x**(5/2)*sqrt(sqrt(x) + 1) - 2*x**(3/2)*sqrt(sqrt(x) + 1) + 3*sqrt(x)*sqrt(sqr t(x) + 1)...