tanh

tanh, function

def const autodiff pure tanh(a: number): number

Returns the hyperbolic tangent of a:

$$\tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}$$

Example

show scalar "tanh(4.2)" with tanh(4.2)

This outputs the following scalar:

tanh(4.2)
0.9995503

Remarks

The function is defined for all real inputs.

See also

User Contributed Notes
0 notes + add a note