def _root_find(f, tl, tr, tol):
    """Return root of f(t) between lg and rg.

    Parameters
    ----------
    f : Stroke
        Stroke object representing the function to be evaluated.
    tl : float
        Lower bound of the search interval.
    tr : float
        Upper bound of the search interval.
    tol : float
        Search tolerance.

    Returns
    -------
    float
        Root of `f(t)` between `lg` and `rg`.
    """

    l, r = tl, tr
    fl = int(f(l))

    while abs(r - l) > tol:

        c = (l + r) / 2
        fc = int(f(c))

        if abs(fl - fc) == 1:
            r = c
        else:
            l = c
            fl = fc

    return (l if fl == 1 else r)