[sympy] Re: Problems with simplify on expressions with floating point numbers

2012-09-27 Thread Larry Wigton
latter. Thank you for your help gentlemen! Larry Wigton On Thursday, September 27, 2012 8:54:19 AM UTC-7, Larry Wigton wrote: > > *** > Python code: > > a= Symbol('a') > b= Symbol('b') > c= S

[sympy] Problems with simplify on expressions with floating point numbers

2012-09-27 Thread Larry Wigton
t from code using sympy 7.1 and also bleeding-edge sympy: x= a*b + a*c factor(x)= a*(b + c) simplify(x)= a*(b + c) x= 1.2*b + 1.2*c factor(x)= 1.2*(b + c) simplify(x)= 1.2*b + 1.2*c simplify(factor(x))= 1.2*b + 1.2*c * why does simp

[sympy] Re: Undesirable behavior from cse

2012-09-26 Thread Larry Wigton
*pg01/pg00, pg01*(1.0 - pg01/pg00)] [(x0, 1/pg00), (x1, pg01*x0)] [x1**2, -2*x1 + 1.0, pg01*(-x1 + 1.0)] I think sympy 7.1 result is better. Larry Wigton On Thursday, September 6, 2012 12:55:44 PM UTC-7, Larry Wigton wrote: > > Python code using cse from sympy: > > from sympy import

Re: [sympy] Another problem with cse under bleeding edge sympy

2012-09-26 Thread Larry Wigton
want to replace the tt guys. So for example if I replaced t1 by something I would clobber t11, t12 etc. That is why I made my own iterator. Larry Wigton On Wednesday, September 26, 2012 10:42:21 AM UTC-7, smichr wrote: > > > class Myname: > > def __init__(self): > &

[sympy] Another problem with cse under bleeding edge sympy

2012-09-26 Thread Larry Wigton
x27;str' * So bleeding edge code fails is this case when I try using my own names for intermediate variables. I should point out this only happens sometimes. Most of the time the bleeding edge code behaves properly. I a

Re: [sympy] Undesirable behavior from cse

2012-09-07 Thread Larry Wigton
On Thursday, September 6, 2012 6:26:38 PM UTC-7, smichr wrote: > > On Fri, Sep 7, 2012 at 1:40 AM, Larry Wigton > > wrote: > > Python code using cse from sympy: > > > > from sympy import * > > x=Symbol('x') > > y=Symbol('y'

[sympy] Undesirable behavior from cse

2012-09-06 Thread Larry Wigton
Python code using cse from sympy: from sympy import * x=Symbol('x') y=Symbol('y') eq1 = 5*x**3*y**2 + y**3 eq2 = 4*x**2*y**3 + y**2 eq = [eq1,eq2] print eq (red,rep) = cse(eq) print red print rep eq = [eq2,eq1] print eq (red,rep) = cse(eq) print red print rep *