code: protected static double GammaCdf(double x, double a) throws IllegalArgumentException
      {
          if (x < 0)
          {
              throw new IllegalArgumentException();
          }
  
          double GI = 0;
          if (a > 200)
          {
              double z = (x - a) / Math.sqrt(a);
              double y = GaussCdf(z);
              double b1 = 2 / Math.sqrt(a);
              double phiz = 0.39894228 * Math.exp(-z * z / 2);
              double w = y - b1 * (z * z - 1) * phiz / 6;  //Edgeworth1
              double b2 = 6 / a;
              int zXor4 = ((int) z) ^ 4;
              double u = 3 * b2 * (z * z - 3) + b1 * b1 * (zXor4 - 10 * z * z + 15);
              GI = w - phiz * z * u / 72;        //Edgeworth2
          }
          else if (x < a + 1)
          {
              GI = Gser(x, a);
          }
          else
          {
              GI = Gcf(x, a);
          }
  
          return GI;
      }
docs: 伽马函数
  
  @param x
  @param a
  @return
  @throws IllegalArgumentException