Function tanh

Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1).

For matrices, the function is evaluated element wise.

Syntax

tanh(x)

Parameters

Parameter Type Description
x number | BigNumber | Complex | Unit | Array | Matrix Function input

Returns

Type Description
number | BigNumber | Complex | Array | Matrix Hyperbolic tangent of x

Examples

// tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)
tanh(0.5);                   // returns 0.46211715726000974
sinh(0.5) / cosh(0.5);  // returns 0.46211715726000974
1 / coth(0.5);               // returns 0.46211715726000974

See also

sinh, cosh, coth