/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber tanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber hardTanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); if (c.getReal() < -1.0) c = new Complex(-1.0, c.getImaginary()); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber tanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
/** * c = tanh(a) * * @param a * a * @param c * c */ public static void complexTanh(GeoVec2D a, GeoVec2D c) { Complex out = new Complex(a.x, a.y); out = out.tanh(); c.x = out.getReal(); c.y = out.getImaginary(); c.setMode(Kernel.COORD_COMPLEX); }
/** * Return the tanh of a complex number * * @param num the tanh of a complex number * @return the tanh of a complex number */ public static IComplexNumber hardTanh(IComplexNumber num) { Complex c = new Complex(num.realComponent().doubleValue(), num.imaginaryComponent().doubleValue()).tanh(); if (c.getReal() < -1.0) c = new Complex(-1.0, c.getImaginary()); return Nd4j.createDouble(c.getReal(), c.getImaginary()); }
public ValueType tanh(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tanh()); } else { return setValue(FastMath.tanh(g.real)); } }
/** * c = cot(a) * * @param a * a * @param c * c */ public static void complexCoth(GeoVec2D a, GeoVec2D c) { Complex out = new Complex(a.x, a.y); out = Complex.ONE.divide(out.tanh()); c.x = out.getReal(); c.y = out.getImaginary(); c.setMode(Kernel.COORD_COMPLEX); }
public ValueType coth(CalculatedValue g) { if (g.isComplex()) { return setComplexValue(g.getComplex().tanh().reciprocal()); } else { return setValue(1.0f / FastMath.tanh(g.real)); } }