docs: 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 FastMath.exp(-FastMath.exp(FastMath.log(1 - k * x) / k));
      }
      else { // Gumbel case:
        return FastMath.exp(-FastMath.exp(-x));
      }
    }