private static double gnorm(double a,double x){
  double sx;
  if ((x <= 0.0) || (a <= 0.0)) {
    return 0.0;
  }
 else {
    sx=Math.sqrt(a) * 3.0 * (Math.pow(x / a,1.0 / 3.0) + 1.0 / (a * 9.0) - 1.0);
    return normalCdf(sx);
  }
}

private static double gnorm ( double a , double x ) { double sx ; if ( ( x <= 0.0 ) || ( a <= 0.0 ) ) { return 0.0 ; } else { sx = Math . sqrt ( a ) * 3.0 * ( Math . pow ( x / a , 1.0 / 3.0 ) + 1.0 / ( a * 9.0 ) - 1.0 ) ; return normalCdf ( sx ) ; } }
compute gamma cdf by a normal approximation
