import mpmath


def cdf(x, k, theta):
    """
    Gamma distribution cumulative distribution function.

    k is the shape parameter
    theta is the scale parameter (reciprocal of the rate parameter)

    Unlike scipy, a location parameter is not included.
    """
    x = mpmath.mpf(x)
    k = mpmath.mpf(k)
    theta = mpmath.mpf(theta)
    return mpmath.gammainc(k, 0, x/theta, regularized=True)