# usencrypt.tanh#

usencrypt.tanh(x, debug=False)#

Computes the hyperbolic tangent of $$x$$ using the definition $$\tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}}$$.

Parameters

x (cipher.Float or float) – The input value.

Returns

The hyperbolic tangent of x.

Return type

usencrypt.cipher.Float

Warning

The precision of this function is largely dependent on the precision of the usencrypt.exp() function. See the warnings for usencrypt.exp().

>>> import usencrypt as ue