sympy/sympy — pull request #7708 by smichr (2014-07-08 02:08:33+00:00)
Title: 4077: use signsimp as first step in cancel

This addresses some of the issues in #4077, namely, it applies signsimp at the beginning of cancel which (in some cases) is a cheap step to make cancel more effective. e.g. see added test for which the "cancelled" form is about as complex as the input rather than being nan (since the expression is actually 0/0).