Dear newsgroup,

I am trying to generate common sub expressions from an equation, but
the results are incorrect for negative values of the symbols.
An example (sympy 0.6.7)


x1=Symbol('x1')
x2=Symbol('x2')
y1=Symbol('y1')
z=Symbol('z', negative=True)

eq=x1*(1+ y1*(x1**2/z**2+x2**2/z**2))/z
v1,v2=cse(eq)
print(eq)
print(v1)
print(v2)

For x1=1, x2=1, y1=0 and z=-1 the original equation and the value of
the cse expression yield different values.

Is this a bug in cse, or can I make certain assumptions on the symbols
to generate correct expressions?

With kind regards,
Pieter Eendebak

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