def gammln(xx):
    cof = [76.18009172947146, (- 86.50532032941678), 24.01409824083091, (- 1.231739572450155), 0.001208650973866179, (- 5.395239384953e-06)]
    y = xx
    x = xx
    tmp = (x + 5.5)
    tmp -= ((x + 0.5) * num.log(tmp))
    ser = 1.000000000190015
    for j in range(6):
        y += 1
        ser += (cof[j] / y)
    return ((- tmp) + num.log(((2.5066282746310007 * ser) / x)))
def gammln(xx):
    cof = [76.18009172947146, (- 86.50532032941678), 24.01409824083091, (- 1.231739572450155), 0.001208650973866179, (- 5.395239384953e-06)]
    y = xx
    x = xx
    tmp = (x + 5.5)
    tmp -= ((x + 0.5) * num.log(tmp))
    ser = 1.000000000190015
    for j in range(6):
        y += 1
        ser += (cof[j] / y)
    return ((- tmp) + num.log(((2.5066282746310007 * ser) / x)))