def gamma_logpdf(bx, logx, a_logx, a_logb, gammaln_a):
    """
    Log-density of :math:`\\mathcal{G}(x|a,b)`.
    
    If you want to get the gradient, just let each parameter be a gradient of
    that term.

    Parameters
    ----------
    bx : ndarray
        :math:`bx`
    logx : ndarray
        :math:`\\log(x)`
    a_logx : ndarray
        :math:`a \\log(x)`
    a_logb : ndarray
        :math:`a \\log(b)`
    gammaln_a : ndarray
        :math:`\\log\\Gamma(a)`
    """
    return a_logb - gammaln_a + a_logx - logx - bx
