I've asked about factoring before but am just jotting down some
observations that I've made in the last few days. I was talking with
Aaron the other day about a routine and suggested he should use
factoring. He says, "that's gong to be expensive." I got to thinking.

There are really 3 (at least) types of factoring:

1) factoring that can be done by inspection of factors. I call this
separation. Pursued recursively, it leads to a possible separation of
variables:

x + x*y + a + a*y
x*(1 + y) + a*(1 + y)
(x+a)*(1+y)

This should be very fast factoring since you are looking for existing
factors, not extractable factors. separatevars should be re-written to
not use factor since that expensive operation is not needed for this.

2) factoring that can be done be extraction of common bases:

x + x**2
x*(1 + x)

This should be pretty fast since you have the factor candidates
already visible but you need to see if they can be extracted from
other bases. This sort of factoring is available through terms_gcd

3) factoring that can be done only by identifying potential factors
and doing trial division.

x**2 - 1
(x+1)*(x-1)

This is available through factor, but perhaps factor should try the
other simpler methods before resorting to level 3 factoring.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.

Reply via email to