code: private static double gSer(double x, double A) {
          // Good for X<A+1.
          double T9=1/A;
          double G=T9;
          double I=1;
          while (T9>G*0.00001) {
              T9=T9*x/(A+I);
              G=G+T9;
              ++I;
          }
          G=G*Math.exp(A*Math.log(x)-x-logGamma(A));
  
          return G;
      }
docs: Internal function used by gammaCdf
  
  @param x
  @param A
  @return