docs: public static double regularizedGammaQ(final double a, final double x) {
      if(Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x < 0.0)) {
        return Double.NaN;
      }
      if(x == 0.0) {
        return 1.0;
      }
      if(x < a + 1.0) {
        // Expected to converge faster
        return 1.0 - regularizedGammaP(a, x);
      }
      // Compute using continued fraction approach.
      final double FPMIN = Double.MIN_VALUE / NUM_PRECISION;
      double b = x + 1 - a;
      double c = 1.0 / FPMIN;
      double d = 1.0 / b;
      double fac = d;
      for(int i = 1; i < MAX_ITERATIONS; i++) {
        double an = i * (a - i);
        b += 2;
        d = an * d + b;
        if(Math.abs(d) < FPMIN) {
          d = FPMIN;
        }
        c = b + an / c;
        if(Math.abs(c) < FPMIN) {
          c = FPMIN;
        }
        d = 1 / d;
        double del = d * c;
        fac *= del;
        if(Math.abs(del - 1.0) <= NUM_PRECISION) {
          break;
        }
      }
      return fac * FastMath.exp(-x + a * FastMath.log(x) - logGamma(a));
    }