function x = GEV_inv ( p, [m,s,k] )
% x = GEV_inv ( p, [m,s,k] )
% compute the inverse CDF of a 
% generalized extreme value (GEV) distribution 
% with parameters m, s, and k and CDF
%  F =  exp(-(1+k*z).^(-1/k) ); where  z = ( x - m ) / s;
% usually -0.5 < k < +0.5

 x = m + (s/k) * ( (-log(p)).^(-k) - 1 );

% GEV_inv ---------------------------------------------------- 
% HP Gavin, 31 Feb 2013,  2019-11-20

