Is the following behavior correct for factor?
>>> from sympy import *
>>> var('x y')
(x, y)
>>> eq = x*(1+2*y+y**2)+1+2*y+y**2
Here we show what happens with and without expand being set:
>>> factor(eq,expand=0)
1 + 2*y + x*(1 + 2*y + y**2) + y**2
>>> factor(eq,expand=1)
(1 + y)**2*(1 + x)
Now try the same when eq is in the denominator:
>>> factor(1/eq,expand=0,frac=1)
1/((1 + x)*(1 + y)**2)
>>> factor(1/eq,expand=1,frac=1)
1/((1 + x)*(1 + y)**2)
I would have expected that expand=0 with frac=1 would have given
1/(1 + 2*y + x*(1 + 2*y + y**2) + y**2)
Also why are the terms reversed in the numerator and denominator?
>>> factor(eq,expand=1)
(1 + y)**2*(1 + x)
>>> factor(1/eq,expand=1,frac=1)
1/((1 + x)*(1 + y)**2)
(Notice that 1+x is changing positions.)
This behavior was also tested in polys9.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.