code: func GammaInc(a, x float64) float64 {
  	// Based on Numerical Recipes in C, section 6.2.
  
  	if a <= 0 || x < 0 || math.IsNaN(a) || math.IsNaN(x) {
  		return math.NaN()
  	}
  
  	if x < a+1 {
  		// Use the series representation, which converges more
  		// rapidly in this range.
  		return gammaIncSeries(a, x)
  	} else {
  		// Use the continued fraction representation.
  		return 1 - gammaIncCF(a, x)
  	}
  }
docs: // GammaInc returns the value of the incomplete gamma function (also
  // known as the regularized gamma function):
  //
  //   P(a, x) = 1 / Γ(a) * ∫₀ˣ exp(-t) t**(a-1) dt