Comment #2 on issue 2818 by smi...@gmail.com: factor() returns nan
http://code.google.com/p/sympy/issues/detail?id=2818

Try apply terms_gcd first (or as_content_primitive) to help it:

cse(factor(terms_gcd(p.rewrite(exp))))
([(x0, dq3**2), (x1, dq2**2), (x2, dq4**2), (x3, I*ddq3), (x4, I*q3), (x5, I*ddq 1), (x6, I*ddq4), (x7, 2*dq4), (x8, dq1*dq4), (x9, dq1*dq3), (x10, I*ddq2), (x11 , dq1*dq2), (x12, I*q4), (x13, I*q2), (x14, exp(x13)), (x15, exp(x4)), (x16, 2*x 11), (x17, 2*x13), (x18, exp(2*x12)), (x19, x14**4), (x20, x15**2), (x21, x19**( 3/4)), (x22, x21**(2/3)), (x23, 4*x15), (x24, dq1*x15), (x25, 2*x15), (x26, dq3* x18), (x27, x11*x18), (x28, x1*x20), (x29, x22*x8), (x30, x14*x20), (x31, x14*x1 8), (x32, x18*x19), (x33, x18*x21), (x34, x20*x21), (x35, x18*x20), (x36, dq1*x1 9*x20)], [(-dq3*x14*x7 + dq3*x21*x7 - dq3*x30*x7 + dq3*x34*x7 - x0*x14 + x0*x18* x30 - x0*x20*x33 + x0*x21 + x0*x30 - x0*x31 + x0*x33 - x0*x34 + x1*x14 - x1*x21 + x1*x31 - x1*x33 + x10*x14 - x10*x18*x30 - x10*x20*x33 + x10*x21 - x10*x30 + x1 0*x31 + x10*x33 - x10*x34 - x14*x2 + x14*x26*x7 - x14*x28 - x14*x3 - x14*x6 - x1 6*x18*x25 - x16*x18 - x16*x19*x20 - x16*x19*x25 - x16*x19 - x16*x20*x32 - x16*x2 0 + x16*x25*x32 + x16*x25 - x16*x32 - x16*x35 - x16 + x18*x2*x30 + x18*x22*x23*x 5 - 2*x18*x22*x24*x7 + x18*x24*x7 - x18*x25*x5 - x18*x3*x30 - x18*x30*x6 - x18*x 5 + x18*x8 - x18*x9 + x19*x20*x5 + x19*x20*x8 - x19*x20*x9 + x19*x24*x7 + x19*x2 5*x5 + x19*x5 + x19*x8 + x19*x9 - x2*x20*x33 + x2*x21 + x2*x30 - x2*x31 + x2*x33 - x2*x34 + x20*x3*x33 + x20*x32*x5 - x20*x32*x8 - x20*x32*x9 + x20*x33*x6 - x20 *x5 - x20*x8 + x20*x9 - x21*x26*x7 + x21*x28 + x21*x3 + x21*x6 - x22*x23*x5 - 2* x22*x24*x7 + x24*x32*x7 + x24*x7 - x25*x32*x5 + x25*x5 + x26*x30*x7 - x26*x34*x7 - x28*x31 + x28*x33 - x3*x30 - x3*x31 + x3*x33 + x3*x34 + x30*x6 + x31*x6 + x32 *x5 - x32*x8 + x32*x9 - x33*x6 - x34*x6 - x35*x5 + x35*x8 + x35*x9 - x5 - x8 - x
9)/(20*sqrt(x18)*sqrt(x20)*x22)])


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

Reply via email to