def relative_error(f1: float, f2: float) -> float:
    """Compute the relative error between two values.

    Parameters
    ----------
    f1 : float
        The reference value.
    f2 : float
        The value being compared.

    Returns
    -------
    float
        The relative error.

    Raises
    ------
    ZeroDivisionError
        `f1` is zero.
    """
    return abs((f1 - f2) / f1)