Christophe wrote:
> FIRST QUESTION
>              So why [(x0, log(x))] is not simply (x0, log(x)) ? Same 
> question for [x0*(1 + x0)*cos(y) + x0**2] ?

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.

cheers,

Toon

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to