public static double cdf(double val,double mu,double sigma,double k){
  final double x=(val - mu) / sigma;
  if (k > 0 || k < 0) {
    if (k * x > 1) {
      return k > 0 ? 1 : 0;
    }
    return Math.exp(-Math.exp(Math.log(1 - k * x) / k));
  }
 else {
    return Math.exp(-Math.exp(-x));
  }
}

public static double cdf ( double val , double mu , double sigma , double k ) { final double x = ( val - mu ) / sigma ; if ( k > 0 || k < 0 ) { if ( k * x > 1 ) { return k > 0 ? 1 : 0 ; } return Math . exp ( - Math . exp ( Math . log ( 1 - k * x ) / k ) ) ; } else { return Math . exp ( - Math . exp ( - x ) ) ; } }
cdf of gev distribution
