question: public static double quantile ( double val , double mu , double sigma , double xi ) { if ( val < 0.0 || val > 1.0 ) { return Double . NaN ; } if ( xi == 0. ) { return mu - sigma * Math . log ( 1 - val ) ; } return mu - sigma / xi * ( 1 - Math . pow ( 1 - val , - xi ) ) ; }
target:  Quantile function of GPD distribution