def _deriv_logaddexp2(x1, x2):
    """The derivative of f(x, y) = log2(2^x + 2^y)"""
    y1 = np.exp2(x1)
    y2 = np.exp2(x2)
    df_dx1 = y1 / (y1 + y2)
    df_dx2 = y2 / (y1 + y2)
    return np.vstack([df_dx1, df_dx2]).T
The derivative of f(x, y) = log2(2^x + 2^y)