code: def gamm_inc(a,x):
      
      assert (x > 0 and a >= 0), "Invalid arguments in routine gamm_inc: %s,%s" % (x,a)
  
      if x < (a+1.0): #Use the series representation
          gam,gln = _gser(a,x)
      else: #Use continued fractions
          gamc,gln = _gcf(a,x)
          gam = 1-gamc
      return np.exp(gln)*gam
docs: Incomple gamma function \gamma; computed from NumRec routine gammp.
      >>> np.isclose(gamm_inc(0.5,1),1.49365)
      True
      >>> np.isclose(gamm_inc(1.5,2),0.6545103)
      True
      >>> np.isclose(gamm_inc(2.5,1e-12),0)
      True