docs: public static double regularizedGammaP(final double a, final double x) {
      // Special cases
      if(Double.isInfinite(a) || Double.isInfinite(x) || !(a > 0.0) || !(x >= 0.0)) {
        return Double.NaN;
      }
      if(x == 0.0) {
        return 0.0;
      }
      if(x >= a + 1) {
        // Expected to converge faster
        return 1.0 - regularizedGammaQ(a, x);
      }
      // Loosely following "Numerical Recipes"
      double term = 1.0 / a;
      double sum = term;
      for(int n = 1; n < MAX_ITERATIONS; n++) {
        // compute next element in the series
        term = x / (a + n) * term;
        sum = sum + term;
        if(sum == Double.POSITIVE_INFINITY) {
          return 1.0;
        }
        if(Math.abs(term / sum) < NUM_PRECISION) {
          break;
        }
      }
      return FastMath.exp(-x + (a * FastMath.log(x)) - logGamma(a)) * sum;
    }