see e.g. https://github.com/sympy/sympy/blob/master/sympy/polys/tests/test_polytools.py#L1130