Comment #9 on issue 2265 by smi...@gmail.com: cse requires subexpressions to be in the exact same order
http://code.google.com/p/sympy/issues/detail?id=2265

It turns out that it's not that bad to check for such sub-matches:

    h[1] >>> cse([a + c + e, a + c + b])
    ([(x0, a + c)], [e + x0, b + x0])

    A, B, C = symbols('A B C', commutative=False)
    l = [A*B*C, A*C]
    assert cse(l) == ([], l)
    l = [A*B*C, A*B]
    assert cse(l) == ([(x0, A*B)], [x0*C, x0])

If you could forward comments regarding cse, that would be helpful. Getting powers to work is not so simple.


    @XFAIL
    def test_powers():
        assert cse(x*y**2 + x*y) == ([(x0, x*y)], [x0*y + x0])


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

Reply via email to