tanh function

double tanh(
  1. double x
)

Calculates the hyperbolic tangent of a number.

The formula used is: tanh(x) = sinh(x) / cosh(x)

  • Parameters:
    • x: The input value.
  • Returns: The hyperbolic tangent of the input value.

Implementation

double tanh(double x) => sinh(x) / cosh(x);