def mp_ab_vs_cd(a, b, c, d):
    """Tests rigorously if ab is greater than, equal to, or less than cd, given
    integers (a, b, c, d). In most cases a quick decision is reached. The
    result is +1, 0, or -1 in the three respective cases.
    See mpmath.pdf (item 33)."""
    if a * b == c * d:
        return 0
    if a * b > c * d:
        return 1
    return -1
