def dispersion_to_variance(disp, exp):
    """
    Converts a dispersion estimate to a variance by applying it to the expected
    value via the relationship ``var = exp + disp * exp**2``.

    Parameters
    ----------
    disp : float or np.ndarray
        The dispersion.
    exp : float or np.ndarray
        The expected value.

    Returns
    -------
    float or np.ndarray
        The variance.
    """
    return exp + disp * exp ** 2
