def grad_beta_logpdf(p: float, alpha: float, beta: float) -> float:
    """Gradient of the log-density function of the Beta distribution.

    Args:
        p: A point on the unit interval at which to evaluate the density.
        alpha: Beta distribution 'success' parameter.
        beta: Beta distribution 'failure' parameter.

    Returns:
        out: The gradient of the log-density of the Beta distribution.

    """
    return (alpha - 1.0) / p - (beta - 1.0) / (1.0 - p)