def event_at_sol(t, func, interpolate, rhs, cache, *args):
    """Helper function to find the root for the event function along the solution.

    Parameters
    ----------
    t : float
        timepoint
    func : callable
        jitted event function.
    interpolate : callable
        jitted interpolation function of the solution
    rhs : callable
        right hand side of the dynamical system.
    cache : AlignedBuffer
        cache of the solver.
    args
        extra arguments required for the interpolation function.

    Returns
    -------
    float

    """
    return func(t, interpolate(t, rhs, cache, *args))