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

New issue 3262 by [email protected]: CSE loses factor of I (imag. unit)
http://code.google.com/p/sympy/issues/detail?id=3262

This script

8< -------------------------------------------------------------------
import sympy as sp
from sympy import exp, atan2, I

a0, a1 = sp.symbols("a0 a1")
b = sp.Symbol("b")

expr = a0*exp(I*atan2(-a1, -a0)) - I*a1*exp(I*atan2(-a1, -a0))
r, (new_expr,) = sp.cse([expr])

print expr
print 80*"-"
for n, e in r:
    print "#######", n
    print e
print 80*"-"
print new_expr
8< -------------------------------------------------------------------

prints the following output:

8< -------------------------------------------------------------------
a0*exp(I*atan2(-a1, -a0)) - I*a1*exp(I*atan2(-a1, -a0))
-------------------------------------------------------------------
####### x0
-a1
-------------------------------------------------------------------
(a0 + x0)*exp(I*atan2(x0, -a0))
8< -------------------------------------------------------------------

Note how the factor I in front of a1 is lost in the CSE'd result.

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