tanh function

double tanh(
  1. double x
)

Implementation

double tanh(double x) => switch (x) {
  > 20 => 1.0,
  < -20 => -1.0,
  _ => sinh(x) / cosh(x),
};