code: public static double logcdf(double val, double shape1, double shape2) {
      if(val == Double.NEGATIVE_INFINITY) {
        return Double.NEGATIVE_INFINITY;
      }
      if(val == Double.POSITIVE_INFINITY) {
        return 0.;
      }
      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 ? 0. : Double.NEGATIVE_INFINITY;
        }
        if(tmp >= 1.) {
          return shape2 == 0 ? Double.NEGATIVE_INFINITY : 0.;
        }
        val = FastMath.exp(FastMath.log1p(-tmp) / shape1);
      }
      if(shape2 == 0.) {
        return -val;
      }
      final double tmp = shape2 * val;
      return tmp < 1. ? FastMath.log1p(-tmp) / shape2 : Double.NEGATIVE_INFINITY;
    }
docs: Cumulative density function, for location = 0, scale = 1
  
  @param val Value
  @param shape1 Shape parameter
  @param shape2 Shape parameter
  @return CDF