docs: public static double cdf(double val, double loc, double scale, double shape1, double shape2) {
      val = (val - loc) / scale;
      if(val == Double.NEGATIVE_INFINITY) {
        return 0.;
      }
      if(val == Double.POSITIVE_INFINITY) {
        return 1.;
      }
      if(val != val) {
        return Double.NaN;
      }
      if(shape1 == 0.) {
        val = FastMath.exp(-val);
      }
      else {
        double tmp = shape1 * val;
        if(tmp == Double.NEGATIVE_INFINITY) {
          return shape2 == 0 ? 1 : 0.;
        }
        if(tmp >= 1.) {
          return shape2 == 0 ? 0 : 1.;
        }
        val = FastMath.exp(FastMath.log1p(-tmp) / shape1);
      }
      if(shape2 == 0.) {
        return FastMath.exp(-val);
      }
      final double tmp = shape2 * val;
      return tmp < 1. ? FastMath.exp(FastMath.log1p(-tmp) / shape2) : 0.;
    }