def chandrupatla(
    t: float,
    x1: float,
    y1: float,
    x2: float,
    y2: float,
    x3: float,
    y3: float,
    x4: float,
    y4: float,
) -> float:
    """
    Estimates the root using Chandrupatla's method.

    Apply inverse quadratic interpolation whenever the interpolation
    is monotonic over the previous bracketing interval. This provides
    good guarantee of convergence.

    Intuitively, use (x1, y1, x2, y2, x3, y3) to check if the function
    looks very linear before attempting to use interpolation.

    If inverse quadratic interpolation should not be used,
    then default back to bisection.
    """
    # Measure the ratios of the differences.
    x = (x2 - x1) / (x3 - x1)
    y = (y2 - y1) / (y3 - y1)
    # Check if the inverse quadratic interpolation is monotonic.
    if y**2 < x < 1 - (1 - y)**2:
        # Numerically stable formulas.
        al = (x3 - x2) / (x1 - x2)
        a = y2 / (y1 - y2)
        b = y3 / (y1 - y3)
        c = y2 / (y3 - y2)
        d = y1 / (y3 - y1)
        return a*b + c*d*al
    # Default to bisection if interpolation shouldn't be used.
    else:
        return 0.5