def calc_loss(df):
    """
    Geometric-mean log error between prediction bands and golden bands.
    Assumes all columns are strictly positive.

    Parameters
    ----------
    df : pandas.DataFrame
        Must contain the columns:
            - 'pred_lower', 'pred_upper'
            - 'golden_lower', 'golden_upper'

    Returns
    -------
    float
        Scalar loss value (the smaller, the better).
    """
    # Element-wise absolute log-ratios
    loss_lower = np.abs(np.log(df["pred_lower"] / df["golden_lower"]))
    loss_upper = np.abs(np.log(df["pred_upper"] / df["golden_upper"]))

    # Average the two means, then exponentiate
    loss = np.exp(0.5 * (loss_lower.mean() + loss_upper.mean()))
    return loss
