Quantile function of Gumbel distribution

@param val Value
@param mu Mode
@param beta Shape
@return Quantile function at position x.
352463
public static double quantile(double val, double mu, double beta) {
    return mu - beta * FastMath.log(-FastMath.log(val));
  }
316918
@Override
	public double getQuantile(double quantile, RandomVariableInterface probabilities) {
		if(isDeterministic()) {
			return valueIfNonStochastic;
		}
		if(size() == 0) {
			return Double.NaN;
		}

		throw new RuntimeException("Method not implemented.");
	}
361630
public static BigDecimal bd(final String val) {
        return val != null && val.length() > 0 ? new BigDecimal(val) : null;
    }
159276
public static double quantile(double val, double loc, double scale) {
    return loc + scale * FastMath.log(val / (1. - val));
  }
709417
def _optm(x, alpha, mu, sigma):
    '''
    '''
    return ss.skewnorm.pdf(x, alpha, mu, sigma)
761598
public static double quantile(double x, double location, double shape) {
    return (x == .5) ? location : (x <= .5) //
        ? x <= 0. ? x < 0. ? Double.NaN : Double.NEGATIVE_INFINITY //
            : location - shape / FastMath.tan(Math.PI * x) //
        : x >= 1. ? x > 1. ? Double.NaN : Double.POSITIVE_INFINITY //
            : location + shape / FastMath.tan(Math.PI * (1 - x));
  }
1046952
public double fMeasure(double beta) {
    final double beta2 = beta * beta;
    double fmeasure = ((1 + beta2) * pairconfuse[0]) / ((1 + beta2) * pairconfuse[0] + beta2 * pairconfuse[1] + pairconfuse[2]);
    return fmeasure;
  }
1074533
public static double cdf(double val, double mu, double sigma, double xi) {
    val = (val - mu) / sigma;
    // Check support:
    if(val < 0) {
      return 0.;
    }
    if(xi < 0 && val > -1. / xi) {
      return 1.;
    }
    return 1 - FastMath.pow(1 + xi * val, -1. / xi);
  }
917734
public static double pdf(double val, double shape, double location, double scale) {
    if(val < location) {
      return 0;
    }
    val = (val - location) / scale;
    double f = shape / scale * FastMath.pow(val, shape - 1.);
    if(f == Double.POSITIVE_INFINITY) {
      return 0;
    }
    double d = 1. + FastMath.pow(val, shape);
    return f / (d * d);
  }
1028944
public static final DoubleMatrix1D zMult(final DoubleMatrix2D A, final DoubleMatrix1D b, final double beta){
		if(A.columns() != b.size()){
			throw new IllegalArgumentException("wrong matrices dimensions");
		}
		final DoubleMatrix1D ret = DoubleFactory1D.dense.make(A.rows());

		if(A instanceof SparseDoubleMatrix2D){
			//sparse matrix
			A.forEachNonZero(new IntIntDoubleFunction() {
				@Override
				public double apply(int i, int j, double Aij) {
					double vi = 0;
					vi += Aij * b.getQuick(j);
					ret.setQuick(i, ret.getQuick(i) + beta * vi);
					return Aij;
				}
			});
		}else{
			//dense matrix
			for(int i=0; i<A.rows(); i++){
				double vi = 0;
				for(int j=0; j<A.columns(); j++){
					vi += A.getQuick(i, j) * b.getQuick(j);
				}
				ret.setQuick(i, beta * vi);
			}
		}

		return ret;
	}
314153
public static double quantile(double val, double sigma) {
    if(!(val >= 0.) || !(val <= 1.)) {
      return Double.NaN;
    }
    if(val == 0.) {
      return 0.;
    }
    if(val == 1.) {
      return Double.POSITIVE_INFINITY;
    }
    return sigma * FastMath.sqrt(-2. * FastMath.log(1. - val));
  }
684289
@Override
	public double getQuantileExpectation(double quantileStart, double quantileEnd) {
		return ((RandomVariableDifferentiableAADPathwise) getValues()).getValues().getQuantileExpectation(quantileStart, quantileEnd);
	}
369490
public SDVariable batchNorm(SDVariable input, SDVariable mean,
                                SDVariable variance, SDVariable gamma,
                                SDVariable beta, double epsilon, int... axis) {
        return batchNorm(null, input, mean, variance, gamma, beta, true, true, epsilon, axis);
    }
686924
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));
    }
  }
1002866
function partial( sigma ) {

	/**
	* FUNCTION: quantile( p )
	*	Evaluates the quantile function for a Rayleigh distribution.
	*
	* @private
	* @param {Number} p - input value
	* @returns {Number} evaluated quantile function
	*/
	return function quantile( p ) {
		if ( p !== p || p < 0 || p > 1 ) {
			return NaN;
		}
		return sigma * sqrt( -ln( pow( 1 - p, 2 ) ) );
	};
}
1372680
private static function _beta($p, $q) {
		if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) {
			return 0.0;
		} else {
			return exp(self::_logBeta($p, $q));
		}
	}
1236354
public static double quantile(double val, double mu, double sigma, double xi) {
    if(val < 0.0 || val > 1.0) {
      return Double.NaN;
    }
    if(xi == 0.) {
      return mu - sigma * FastMath.log(1 - val);
    }
    return mu - sigma / xi * (1 - FastMath.pow(1 - val, -xi));
  }