Hyperbolic Tangent Special-Function Approximation

Fast, reduced-precision hardware approximation of tanh(x).

Vendor-Neutral Definition

d ≈ tanh(a); precision is hardware- and instruction-specific.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler translations.
equivalent with restrictions Both provide a fast, reduced-precision hardware approximation of tanh(x).
Property NVIDIA PTX AMDGPU
Instruction tanh v_tanh_f32
ISA Layer Virtual Native
Data Types - f32
Version / Target Introduced PTX ISA 7.0 -

Important Differences

  • Approximation error bounds (max ULP) are hardware-generation-specific on both vendors and are not guaranteed to match; do not assume bit-identical results across vendors even when both are described as 'approx'.

Source Evidence

Verification method: documentation