Toon Verstraelen a écrit :
> That is how cse works. It stands for common subexpression elimination. You
> are
> probably using it in way that is more specific that the general purpose of
> cse.
> It might very well be that some expressions have multiple common
> subexpressions.
> Try for example:
>
> cse((sqrt(x)-sin(x))*(sqrt(x)+sin(x)))
>
> Cse will not always work for your purpose either. Try for example:
>
> cse(log(x))
>
> There are no common subexpressions in this one, so no polynomial comes out.
> I'm
> not sure if that matters for your purposes. The second return value can be a
> list too. Try for example this one:
>
> cse([sqrt(x), 1-sqrt(x)])
>
> You might argue that when no list of expressions is given, no list should be
> returned either. Open an issue if it bothers you. In the long run, I'll
> certainly patch it due to my interests in cse.
>
Thanks for all this informations which give me that something like
cse([log(x), cos(y), log(x)**2 + cos(y)*log(x)*(1+log(x))])
which will do what I need.
Best regards.
Christophe
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---