See https://code.google.com/p/sympy/issues/detail?id=3699.