> Is gcdfactor() any different from the following?
>
> In [1]: f = x**2*exp(x)+exp(x+y)*x/y
>
> In [2]: f
> Out[2]:
>            x + y
>  2  x   x⋅ℯ    
> x ⋅ℯ  + ────────
>            y    
>
> In [3]: factor(f)
> Out[3]:
>   ⎛     y⎞  
>   ⎜    ℯ ⎟  x
> x⋅⎜x + ──⎟⋅ℯ
>   ⎝    y ⎠  
>

In this case, no. But gcdfactor would do nothing to 1-x**2 whereas
factor would return (1+x)*(1-x). Removing a common factor from all
terms before beginning the formal factoring process makes the regular
factoring a lot easier. I think the place for this type of function is
in simplify. It's like collect but it's not collecting for a given
term, it's collecting from every term whatever is in common and can be
extracted multiplicatively.

--

You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.


Reply via email to