def diffusion_index(trans_24, diffusion_slope=-1.33, diffusion_intercept=1.15):
    """
    Computes the diffusion index, the ratio between diffuse and direct
    solar radiation. The results are clipped between 0 and 1.

    .. math ::
        I_{diff} = a_{diff}+b_{diff}\\tau

    Parameters
    ----------
    trans_24 : float
        daily atmospheric transmissivity
        :math:`\\tau`
        [-]
    diffusion_slope : float
        slope of diffusion index vs transmissivity relationship
        :math:`b_{diff}`
        [-]
    diffusion_intercept : float
        intercept of diffusion index vs transmissivity relationship
        :math:`a_{diff}`
        [-]

    Returns
    -------
    diffusion_index : float
        diffusion_index
        :math:`I_{diff}`
        [-]

    """
    res = diffusion_intercept + trans_24 * diffusion_slope
    res = res.clip(0, 1)
    return res
