@Override protected ExprEval eval(double param) { return ExprEval.of(Math.expm1(param)); } }
/** * Important note: do not change anything in the following function. * It has been carefully designed and tested for numerical accuracy. * In particular, the use of log1p and expm1 is critically important. * @param kf the value of k as a double * @param nf the value of n as a double * @param col the given column * @return the quantity qnj */ static double qnj(final double kf, final double nf, final int col) { final double tmp1 = -1.0 / (kf * (Math.pow(2.0, col))); final double tmp2 = Math.log1p(tmp1); return (-1.0 * (Math.expm1(nf * tmp2))); }
/** * Returns e<sup>x</sup>-1. */ public static double expm1(double x) { return java.lang.Math.expm1(x); }
@Override public double apply(double... args) { return Math.expm1(args[0]); } };
/** {@inheritDoc} */ @Override public RealVector mapExpm1ToSelf() { for (int i = 0; i < data.length; i++) { data[i] = Math.expm1(data[i]); } return this; }
/** {@inheritDoc} */ @Override public double value(double d) { return Math.expm1(d); } };
@Override public Double evaluate(Number value){ return Math.expm1(value.doubleValue()); } };
protected void initArrays(int d) { double dt, c; for (int j = 0; j < d; j++) { dt = t[j+1] - t[j]; c = -Math.expm1(-alpha * dt)*sigma*sigma/(4.0*alpha); parc[j] = c; parlam[j] = Math.exp(-alpha * dt) / c; } }
/** * {@inheritDoc} * * For scale {@code m} and shape {@code s}, the variance is * {@code (exp(s^2) - 1) * exp(2 * m + s^2)}. */ public double getNumericalVariance() { final double s = shape; final double ss = s * s; return (Math.expm1(ss)) * Math.exp(2 * scale + ss); }
private double calculateExponential(double result) { if (!logarithmicWeighting) { return result; } return Math.signum(result) * (Math.expm1(Math.abs(result))); }
/** * This is the Taylor expansion of $$\frac{\exp(x)-1}{x}$$ - note for $$|x| > 10^{-10}$$ the expansion is note used . * * @param x the value * @return the result */ public static double epsilon(double x) { if (Math.abs(x) > 1e-10) { return Math.expm1(x) / x; } return taylor(x, COEFF1); }
private static double invGaver (int n, double u) { // Gaver-Kafadar normal approximation for the inverse // \cite{tGAV84a} double z = NormalDist.inverseF01 (u); double q = z / (n - 1.0); double v = q * q * (n - 1.5); double t = Math.sqrt(n * Math.expm1(v)); if (u >= 0.5) return t; else return -t; }
/** * This is the Taylor expansion of the first derivative of $$\frac{\exp(x)-1}{x}$$. * * @param x the value * @return the result */ public static double epsilonP(double x) { if (Math.abs(x) > 1e-7) { return ((x - 1) * Math.expm1(x) + x) / x / x; } return taylor(x, COEFF2); }
public static double expm1(double v) { if (Double.POSITIVE_INFINITY == v) { return v; } double result = Math.expm1(v); if (Double.isInfinite(result)) { throw Py.OverflowError(Double.toString(v)); } return result; }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 expm1() { return new Decimal64(Math.expm1(value)); }
@Override protected ExprEval eval(double param) { return ExprEval.of(Math.expm1(param)); } }
@Override public Object expm1( final MonadicOp op ) throws MathematicsException { return Math.expm1( visitNumber( op.getValue() ).doubleValue() ); }
@Override public final double eval() { return Math.expm1(a().eval()); } }
@Override public double getVariance() { double exp1 = this.getLogNormalVariance(); double exp2 = 2.0 * this.getLogNormalMean() + this.getLogNormalVariance(); // (Math.exp(exp1)-1)*Math.exp(exp2) return (Math.expm1( exp1 ) * Math.exp( exp2 )); }
@Override public double getVariance() { double exp1 = this.getLogNormalVariance(); double exp2 = 2.0 * this.getLogNormalMean() + this.getLogNormalVariance(); // (Math.exp(exp1)-1)*Math.exp(exp2) return (Math.expm1( exp1 ) * Math.exp( exp2 )); }