The more aggressive (and slower) form is

cs = sp.cse(dQ_dR, optimizations='basic')


which results in  

x0 = X_A - X_B
x1 = Y_A - Y_B
x2 = Z_A - Z_B
x3 = 1/sqrt(x0**2 + x1**2 + x2**2)
x4 = x0*x3
x5 = x1*x3
x6 = x2*x3
J(1, 1) = x4
J(1, 2) = x5
J(1, 3) = x6
J(1, 4) = -x4
J(1, 5) = -x5
J(1, 6) = -x6

Reference: 
http://docs.sympy.org/dev/modules/rewriting.html#module-sympy.simplify.cse_main

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8dfa16c4-be17-4ac5-905b-78eaf5664735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to