tanh#

rbc.stdlib.elementwise_functions.tanh(x)#

Calculates an implementation-dependent approximation to the hyperbolic tangent for each element x_i of the input array x.

Examples

>>> from rbc.stdlib import array_api
>>> @heavydb('double[](double[])')
... def array_api_tanh(x):
...     return array_api.tanh(x)
>>> array_api_tanh([0.0, np.pi/2, np.pi]).execute()
array([0.        , 0.91715235, 0.9962721 ], dtype=float32)

Array-API ‘tanh’ doc