Skip to content

FTANHA

Operation

Approximates hyperbolic tangent for finite values and signed infinity.

Assembler Syntax

FTANHA.{S|D}(z) Fn(s), Fn(d)

Privilege

Unprivileged

Required CPUID flags

FP

FPTRANSA

Repeat eligibility

REP eligible

Computes the tanh(x) reference over all finite values and signed infinity after DAZ and writes an implementation-bounded S- or D-format approximation under the selected FPTRANSA accuracy contract.

The required FPTRANSA_ACCURACY contract is 0x0023.

Special values

  • Infinite source: the result is one with the sign of the source.

  • Zero source: the result is the source.

Exact anchors

  • tanh(+0) = +0

  • tanh(-0) = -0

  • tanh(signed infinity) = signed 1

Required properties

  • odd

  • monotonically increasing

  • result is in [-1, 1]

2.75in

Encodings

FTANHA.{S|D}(z) Fn(s), Fn(d)

Format: Instruction format for FTANHA.{S|D}(z) Fn(s), Fn(d)

Format: Instruction format for FTANHA.{S|D}(z) Fn(s), Fn(d)