sympy/sympy — pull request #1997 by smichr (2013-04-10 08:39:38+00:00)
Title: Mod handles more simplification

While still trying to keep evaluation fast, Mod will now
handle more now in removing a gcd from the terms and
removing known terms from a sum:
*master*

```
>>> Mod(x*y,x*(y+1))
Mod(x*y, x*(y + 1))
>>> Mod(x+y,y)
Mod(x + y, y)
>>> Mod(4*x, 2*x)
Mod(4*x, 2*x)

*this PR*

```
>>> (x*y) % (x*(y+1))
x*Mod(y, y + 1)
>>> Mod(x + y, y)
Mod(x, y)
>>> Mod(4*x, 2*x)
0
```