docs: public static double pdf(double x, double mu, double sigma, double k) {
      if(x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {
        return 0.;
      }
      x = (x - mu) / sigma;
      if(k > 0 || k < 0) {
        if(k * x > 1) {
          return 0.;
        }
        double t = FastMath.log(1 - k * x);
        return t == Double.NEGATIVE_INFINITY ? 1. / sigma //
            : t == Double.POSITIVE_INFINITY ? 0. //
                : FastMath.exp((1 - k) * t / k - FastMath.exp(t / k)) / sigma;
      }
      else { // Gumbel case:
        return FastMath.exp(-x - FastMath.exp(-x)) / sigma;
      }
    }