Berin Loritsch wrote:
Speaking of accademic, anyone have a Java implementation of tanh(x)? The
java.lang.Math class only has tan(x) or atan(x), but no hyperbolic function.

Trivial, see http://functions.wolfram.com/ElementaryFunctions/Tanh/02/ (yeah, wolfram research is for mathematics on the net what wikipedia is for the rest)

 double tanh(double x) {
  return (Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
 }

Have fun!

J.Pietschmann




Reply via email to