def sekant(f, xn, xm, tol=1e-12, n=0):
    """
    RECURSIVE

    Parameters
    ==========
        f   :   callable, function to find roots of
        xn  :   x_n (start with x_1)
        xm  :   x_n-1 (start with x_0)
        tol :   tolerance
        n   :   number of steps

    Returns
    =======
        xn  :   root
        n   :   steps until result

    """
    return (xn, n) if abs(xn-xm) < tol or abs(f(xn)) < tol \
            else sekant(f, xn - (xn - xm) / (f(xn) - f(xm)) * f(xn), xn, tol, n+1)