Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3138 by [email protected]: polys expanded representation problem
http://code.google.com/p/sympy/issues/detail?id=3138

There is something a little strange about the expanded representation of the following after replacing `x` with `-y+2`:

    >>> Poly(x**2 + 2*x*y + y**2 - 4, x, y, domain='ZZ').subs(x, -y+2)
    Poly(-y + 2**2 + 2*-y + 2*y + y**2 - 4, -y + 2, y, domain='ZZ')

Notice all the unevaluated terms (`2**2` should be `4`, `2*-y` should be `-2*y` and cancel the `2*y`, ...)

The expanded form should be zero:

    >>> _.as_expr()
    y**2 + 2*y*(-y + 2) + (-y + 2)**2 - 4
    >>> _.expand()
    0



--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to