def _ln_gamma_function(alpha):
 if (alpha <= 0):
  raise ValueError
 x = alpha
 f = 0
 if (x < 7):
  f = 1
  z = x
  while (z < 7):
   f *= z
   z += 1
  x = z
  f = (- log(f))
 z = (1 / (x * x))
 return ((((f + ((x - 0.5) * log(x))) - x) + 0.918938533204673) + ((((((((-0.000595238095238) * z) + 0.000793650793651) * z) - 0.002777777777778) * z) + 0.083333333333333) / x))

def _ln_gamma_function ( alpha ) : if ( alpha <= 0 ) : raise ValueError x = alpha f = 0 if ( x < 7 ) : f = 1 z = x while ( z < 7 ) : f *= z z += 1 x = z f = ( - log ( f ) ) z = ( 1 / ( x * x ) ) return ( ( ( ( f + ( ( x - 0.5 ) * log ( x ) ) ) - x ) + 0.918938533204673 ) + ( ( ( ( ( ( ( ( - 0.000595238095238 ) * z ) + 0.000793650793651 ) * z ) - 0.002777777777778 ) * z ) + 0.083333333333333 ) / x ) )
compute the log of the gamma function for a given alpha .