docs: public static double logregularizedGammaP(final double a, final double x) {
      // Special cases
      if(Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x < 0.0)) {
        return Double.NaN;
      }
      if(x == 0.0) {
        return Double.NEGATIVE_INFINITY;
      }
      if(x >= a + 1) {
        // Expected to converge faster
        // FIXME: and in log?
        return FastMath.log(1.0 - regularizedGammaQ(a, x));
      }
      // Loosely following "Numerical Recipes"
      double del = 1.0 / a;
      double sum = del;
      for(int n = 1; n < Integer.MAX_VALUE; n++) {
        // compute next element in the series
        del *= x / (a + n);
        sum = sum + del;
        if(Math.abs(del / sum) < NUM_PRECISION || sum >= Double.POSITIVE_INFINITY) {
          break;
        }
      }
      if(Double.isInfinite(sum)) {
        return 0;
      }
      // TODO: reread numerical recipes, can we replace log(sum)?
      return -x + (a * FastMath.log(x)) - logGamma(a) + FastMath.log(sum);
    }