sympy/sympy — pull request #664 by smichr (2011-10-17 06:36:39+00:00)
Title: Primitive3

This builds off of the work of pull request https://github.com/sympy/sympy/pull/567 and adds a collect_terms function and uses rprimitive in terms_gcd so a fast gcd can be extracted without destroying the initial structure (and without unecessarily expanding multinomials).