public static double quantile(double val,double sigma){
  if (!(val >= 0.) || !(val <= 1.)) {
    return Double.NaN;
  }
 else   if (val == 0.) {
    return 0.;
  }
 else   if (val == 1.) {
    return Double.POSITIVE_INFINITY;
  }
 else {
    return sigma * Math.sqrt(-2. * Math.log(val));
  }
}

public static double quantile ( double val , double sigma ) { if ( ! ( val >= 0. ) || ! ( val <= 1. ) ) { return Double . NaN ; } else if ( val == 0. ) { return 0. ; } else if ( val == 1. ) { return Double . POSITIVE_INFINITY ; } else { return sigma * Math . sqrt ( - 2. * Math . log ( val ) ) ; } }
quantile function of rayleigh distribution
