def _igam(a, x):
 ax = math.exp((((a * math.log(x)) - x) - math.lgamma(a)))
 r = a
 c = 1.0
 ans = 1.0
 while True:
  r += 1.0
  c *= (x / r)
  ans += c
  if ((c / ans) <= MACHEP):
   return ((ans * ax) / a)

def _igam ( a , x ) : ax = math . exp ( ( ( ( a * math . log ( x ) ) - x ) - math . lgamma ( a ) ) ) r = a c = 1.0 ans = 1.0 while True : r += 1.0 c *= ( x / r ) ans += c if ( ( c / ans ) <= MACHEP ) : return ( ( ans * ax ) / a )
left tail of incomplete gamma function .