'The tail degree in ``x`` or the main variable.
Note that the degree of 0 is negative infinity (the SymPy object -oo)'

def tail_degree(f, x=None):

    i = f.ring.index(x)
    if (not f):
        return (- oo)
    elif (i < 0):
        return 0
    else:
        return min([monom[i] for monom in f.itermonoms()])
