PTX ISA v9.4

9.7.3.22. Floating Point Instructions: tanh

tanh

Find the hyperbolic tangent of a value (in radians)

Syntax

ptx
tanh.approx.f32 d, a;

Description

Take hyperbolic tangent value of a.

The operands d and a are of type .f32.

Semantics

ptx
d = tanh(a);

Notes

tanh.approx.f32 implements a fast approximation to FP32 hyperbolic-tangent.

Results of tanh for various corner-case inputs are as follows:

Input Result
-Inf -1.0
-0.0 -0.0
+0.0 +0.0
+Inf 1.0
NaN NaN

The maximum relative error over the entire floating point range is 2^-11. The subnormal numbers are supported.

PTX ISA Notes

Introduced in PTX ISA version 7.0.

Target ISA Notes

Requires sm_75 or higher.

Examples

ptx
tanh.approx.f32 ta, a;
esc
Type to search across all documentation