/** {@inheritDoc} */ public double value(double x) { return FastMath.tanh(x); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 tanh() { return new Decimal64(FastMath.tanh(value)); }
/** {@inheritDoc} */ public SparseGradient tanh() { final double t = FastMath.tanh(value); return new SparseGradient(t, 1 - t * t, derivatives); }
final double t = FastMath.tanh(operand[operandOffset]); function[0] = t;
@Override public float op(float origin, float other) { double tanh = FastMath.tanh(origin); return (float) (1.0 - tanh * tanh); }
@Override public double op(double origin, double other) { double tanh = FastMath.tanh(origin); return 1.0 - tanh * tanh; }
@Override public double gradient(double input) { final double tanhX = FastMath.tanh(input); return 1d - tanhX * tanhX; }
/** {@inheritDoc} */ public double value(double x) { return FastMath.tanh(x); }
@Override public float op(float origin) { return (float) FastMath.tanh(origin); }
@Override public double op(double origin, double other) { return FastMath.tanh(origin); }
@Override public double op(double origin) { double tanh = FastMath.tanh(origin); return 1.0 - tanh * tanh; }
@Override public float op(float origin) { double tanh = FastMath.tanh(origin); return (float) (1.0 - tanh * tanh); }
@Override public double apply(double input) { return FastMath.tanh(input); }
@Override public float op(float origin, float other) { return (float) FastMath.tanh(origin); }
@Override public double op(double origin) { return FastMath.tanh(origin); }
/** {@inheritDoc} */ public SparseGradient tanh() { final double t = FastMath.tanh(value); return new SparseGradient(t, 1 - t * t, derivatives); }
/** {@inheritDoc} * @since 3.2 */ public Decimal64 tanh() { return new Decimal64(FastMath.tanh(value)); }
@Test public void testMathTanHFast() { for (double i = 0; i < numItr; ++i) { double val = FastMath.tanh(i); } }
public ValueType tanh(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tanh()); } else { return setValue(FastMath.tanh(g.real)); } }
public ValueType coth(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tanh().reciprocal()); } else { return setValue(1.0f / FastMath.tanh(g.real)); } }