Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2617 by pieter.e...@gmail.com: cse not working correctly with
powers
http://code.google.com/p/sympy/issues/detail?id=2617
When working with powers and negative numbers cse yields incorrect
expressions. Example code is below (tested on 0.6.7 and 0.7.1). The issue
was also reported to the mailing list.
import sympy
from sympy import *
print('sympy version: %s' % sympy.__version__)
x1=Symbol('x1')
y1=Symbol('y1')
z=Symbol('z', negative=True)
eq=(x1**2/z**2+1/z**2)/z
v1,v2=cse(eq, sympy.numbered_symbols('a'))
print('equation: %s' % eq)
print('cse: %s, formula: %s' % (v1, v2) )
sdict={x1:1,y1:0, z:-1}
yy=eq.subs(sdict)
print('substitution in original: %s' % yy)
v1s=[ (x[0], x[1].subs(sdict)) for x in v1]
xx=v2[0].subs(sdict)
yy=xx.subs(dict(v1s))
print('substitution in cse expression: %s ' % yy)
--
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.