public double cosh(double x) { double ex, mex; ex = Math.exp(x); mex = 1 / ex; return (ex + mex) / 2; }
public double tanh(double x) { double ex, mex; ex = Math.exp(x); mex = 1 / ex; return (ex - mex) / (ex + mex); }