def _heaviside(x1: float, x2: float) -> float:
    """A custom Heaviside function for Numba support.

    Parameters
    ----------
    x1 : float
        The value at which to calculate the function.

    x2 : float
        The value of the function at 0. Typically, this is 0.5 although 0 or 1 are also used.

    Returns
    -------
    val : float
        The value of the Heaviside function at the given point.

    """
    if x1 > 0:
        return 1.0
    elif x1 == 0:
        return x2
    else:
        return 0.0