docs: public static double regularizedGammaQ(final double a,
                                             double x,
                                             double epsilon,
                                             int maxIterations) {
          double ret;
  
          if (Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x < 0.0)) {
              ret = Double.NaN;
          } else if (x == 0.0) {
              ret = 1.0;
          } else if (x < a + 1.0) {
              // use regularizedGammaP because it should converge faster in this
              // case.
              ret = 1.0 - regularizedGammaP(a, x, epsilon, maxIterations);
          } else {
              // create continued fraction
              ContinuedFraction cf = new ContinuedFraction() {
  
                  @Override
                  protected double getA(int n, double x) {
                      return ((2.0 * n) + 1.0) - a + x;
                  }
  
                  @Override
                  protected double getB(int n, double x) {
                      return n * (a - n);
                  }
              };
  
              ret = 1.0 / cf.evaluate(x, epsilon, maxIterations);
              ret = Math.exp(-x + (a * Math.log(x)) - logGamma(a)) * ret;
          }
  
          return ret;
      }