def score_gamma(x, k, theta):
    """
    Compute score function of one-dimensional Gamma distribution.
    inputs: x: real number at which the score function is evaluated
            k: positive number (shape parameter of Gamma distribution)
            theta: positive number (scale parameter of Gamma distribution)
    output: score
    """
    return (k - 1) / x - 1 / theta