usencrypt.atanh#

usencrypt.atanh(x, n=35, debug=False)#

Computes the hyperbolic arctangent of \(x\) using the Newton-Raphson method.

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

  • n (int) – The number of iterations for the Newton-Raphson method. Defaults to 35.

Returns

The hyperbolic tangent of x.

Return type

usencrypt.cipher.Float

Note

It takes 35 iterations for the Newton-Raphson method to give negligible error on the range \(−0.9 < x < 0.9\).

Warning

Is dependent on usencrypt.log(), but only for a very small range. See the warnings for usencrypt.log().

See also

Examples
>>> import usencrypt as ue
>>> a = ue.encrypt(0.75)
>>> a_atanh = ue.atanh(a)
>>> a_atanh
(0x7f843a4afc70) Float: 0x87793b6a4fdc00684efd07a1445e95945a44cd7e7cd56c1c14ea75f0f187225e
>>> ue.decrypt(a_atanh)
0.9729550837073475