public static double cdf(double x,double mu,double sigma,double lambda){
  if (x == Double.NEGATIVE_INFINITY) {
    return 0.;
  }
  if (x == Double.POSITIVE_INFINITY) {
    return 1.;
  }
  final double u=lambda * (x - mu);
  final double v=lambda * sigma;
  final double v2=v * v;
  final double logphi=Math.log(NormalDistribution.cdf(u,v2,v));
  return NormalDistribution.cdf(u,0.,v) - Math.exp(-u + v2 * .5 + logphi);
}

public static double cdf ( double x , double mu , double sigma , double lambda ) { if ( x == Double . NEGATIVE_INFINITY ) { return 0. ; } if ( x == Double . POSITIVE_INFINITY ) { return 1. ; } final double u = lambda * ( x - mu ) ; final double v = lambda * sigma ; final double v2 = v * v ; final double logphi = Math . log ( NormalDistribution . cdf ( u , v2 , v ) ) ; return NormalDistribution . cdf ( u , 0. , v ) - Math . exp ( - u + v2 * .5 + logphi ) ; }
cumulative probability density function ( cdf ) of an exgauss distribution .
