class ASTCosh extends ASTUniPrefixOp { @Override String opStr(){ return "cosh"; } @Override ASTOp make() {return new ASTCosh ();} @Override double op(double d) { return Math.cosh(d);}} class ASTSinh extends ASTUniPrefixOp { @Override String opStr(){ return "sinh"; } @Override ASTOp make() {return new ASTSinh ();} @Override double op(double d) { return Math.sinh(d);}}
@Override protected ExprEval eval(double param) { return ExprEval.of(Math.cosh(param)); } }
public BigDecimal eval(List<? extends Number> parameters) { assertNotNull(parameters.get(0)); /** Formula: sech(x) = 1 / cosh(x) */ double one = 1; double d = Math.cosh(parameters.get(0).doubleValue()); return new BigDecimal((one / d), mc); } });
public BigDecimal eval(List<? extends Number> parameters) { assertNotNull(parameters.get(0)); double d = Math.cosh(parameters.get(0).doubleValue()); return new BigDecimal(d, mc); } });
public static double coth(double x) { return Math.cosh(x) / Math.sinh(x); }
/** * Returns the complex cosine of this complex number. * * @return the complex cosine of this complex number */ public Complex cos() { return new Complex(Math.cos(re) * Math.cosh(im), -Math.sin(re) * Math.sinh(im)); }
/** * Returns the complex sine of this complex number. * * @return the complex sine of this complex number */ public Complex sin() { return new Complex(Math.sin(re) * Math.cosh(im), Math.cos(re) * Math.sinh(im)); }
public static double cosh(RValue x) throws EvaluationException { return Math.cosh(x.getValue()); }
/** * The hyperbolic tangent. * * @param x The argument. * @return The tanh(x) = sinh(x)/cosh(x). */ static public BigDecimal tanh(final BigDecimal x) { if (x.compareTo(BigDecimal.ZERO) < 0) { return tanh(x.negate()).negate(); } else if (x.compareTo(BigDecimal.ZERO) == 0) { return BigDecimal.ZERO; } else { BigDecimal xhighpr = scalePrec(x, 2); /* tanh(x) = (1-e^(-2x))/(1+e^(-2x)) . */ BigDecimal exp2x = exp(xhighpr.multiply(new BigDecimal(-2))); /* The error in tanh x is err(x)/cosh^2(x). */ double eps = 0.5 * x.ulp().doubleValue() / Math.pow(Math.cosh(x.doubleValue()), 2.0); MathContext mc = new MathContext(err2prec(Math.tanh(x.doubleValue()), eps)); return BigDecimal.ONE.subtract(exp2x).divide(BigDecimal.ONE.add(exp2x), mc); } } /* BigDecimalMath.tanh */
a = Math.ceil(1.5); a = Math.cos(0.0); a = Math.cosh(0.0); a = Math.exp(0.0); a = Math.exp(1.0);
@Description("hyperbolic cosine") @ScalarFunction @SqlType(StandardTypes.DOUBLE) public static double cosh(@SqlType(StandardTypes.DOUBLE) double num) { return Math.cosh(num); }
d = 1.0 / sigmaSq; } else { val = Math.log(Math.cosh(norm)); d = (2 * (1 / (Math.exp(-2.0 * norm) + 1)) - 1.0) / sigmaSq;
return Math.sinh(expression.getValue()); case COSH: return Math.cosh(expression.getValue()); case LOG: return Math.log10(expression.getValue());
public Complex sin() { return new Complex(Math.sin(re) * Math.cosh(im), Math.cos(re) * Math.sinh(im)); }
public Complex cos() { return new Complex(Math.cos(re) * Math.cosh(im), -Math.sin(re) * Math.sinh(im)); }
@FunctionName("Cosh") @Description("Returns the hyperbolic cosine of a number.") public static double cosh(double number) { return Math.cosh(number); }
break; case COSH: result = ValueDouble.get(Math.cosh(v0.getDouble())); break; case COT: {
break; case COSH: result = ValueDouble.get(Math.cosh(v0.getDouble())); break; case COT: {
public static ComplexNumber sin(ComplexNumber z) { ArgChecker.notNull(z, "z"); double x = z.getReal(); double y = z.getImaginary(); return new ComplexNumber(Math.sin(x) * Math.cosh(y), Math.cos(x) * Math.sinh(y)); }