docs: public static double pdf(double val, double loc, double scale, double shape1, double shape2) {
      val = (val - loc) / scale;
      final double logc = logcdf(val, shape1, shape2);
      if(shape1 == 1.) {
        // Then val will usually become 0.
        return val >= 1 ? 0 : FastMath.exp(logc * (1. - shape2)) / scale;
      }
      if(shape1 != 0.) {
        val = shape1 * val;
        if(val >= 1) {
          return 0;
        }
        val = (1. - 1. / shape1) * FastMath.log1p(-val);
      }
      if(Double.isInfinite(val)) {
        return 0;
      }
      val = FastMath.exp(-val);
      return Double.isInfinite(val) ? 0. : val / scale * FastMath.exp(logc * (1. - shape2));
    }