tanh function

double tanh(
  1. double x
)

Implementation

double tanh(double x) {
  var e2x = math.exp(2 * x);
  return (e2x - 1) / (e2x + 1);
}