def __secant(x_list, fx_list):
    """

    Applies secant method to find root *x* of function *f(x)*.
    If not enough (*x*, *f(x)*) value pairs are available to apply
    secant method, a new *x* value is guessed by slightly changing the
    initial *x* value

    Parameters
    ----------
    x_list: ndarray, list
        A list of known function inputs (x-values).
    fx_list: ndarray, list
        A list of known function outputs corresponding to the function inputs
        in ``x_list``.

    Returns
    -------
    x: scalar
        An estimate of the root of function f(x).

    """
    if fx_list[-1] != 0:
        if len(x_list) > 1 and abs(fx_list[-1]) != abs(fx_list[-2]):
            x_0 = x_list[-2]
            x_1 = x_list[-1]
            fx_0 = fx_list[-2]
            fx_1 = fx_list[-1]
            slope = (fx_1 - fx_0) / (x_1 - x_0)
            return x_1 + -fx_1 / slope
        else:
            return x_list[0] * 0.9 + 0.0001
    else:
        return x_list[-1]
