Skip to content

Approximate Floating-Point Transcendental Instructions

Summary

Approximate Floating-Point Transcendental Instructions Summary (Informative)

Mnemonic Brief description
Approximates arccosine in radians for finite source magnitudes at most one.
Approximates arcsine in radians for finite source magnitudes at most one.
Approximates arctangent in radians for finite values and signed infinity.
Approximates hyperbolic arctangent for finite source magnitudes at most one.
Approximates cosine in radians over the reduced interval from minus pi/4 to pi/4.
Approximates hyperbolic cosine for finite values and signed infinity.
Approximates e raised to the source for finite values and signed infinity.
Approximates e raised to the source minus one without an intermediate rounded exponential.
Approximates base-10 logarithm for positive values, with zero as the divide-by-zero boundary.
Approximates base-2 logarithm for positive values, with zero as the divide-by-zero boundary.
Approximates natural logarithm for positive values, with zero as the divide-by-zero boundary.
Approximates natural log of one plus the source, with minus one as the divide-by-zero boundary.
Approximates sine in radians over the reduced interval from minus pi/4 to pi/4.
Atomically writes paired sine and cosine approximations over the reduced pi/4 interval.
Approximates hyperbolic sine for finite values and signed infinity.
Approximates tangent in radians over the reduced interval from minus pi/4 to pi/4.
Approximates hyperbolic tangent for finite values and signed infinity.
Approximates ten raised to the source for finite values and signed infinity.
Approximates two raised to the source for finite values and signed infinity.

FPTRANSA Common Model

For an approximate transcendental instruction, \(x'\) is the source after FSTATUS.DAZ, \(y=f(x')\) is the exact real reference value named by its accuracy contract, and \(a\) is the approximate result before FSTATUS.FTZ. For a format with precision \(p\) and minimum normal exponent \(e_{\min}\), define

\[\operatorname{ulp}_F(y) = \begin{cases} 2^{\max(\lfloor\log_2 |y|\rfloor-p+1,\ e_{\min}-p+1)}, & y\ne0,\\ 2^{e_{\min}-p+1}, & y=0. \end{cases}\]

The measured error is \(|a-y|/\operatorname{ulp}_F(y)\). The bound applies only to finite reference values within the selected format's finite range; NaN, infinity, and overflow follow the instruction's special-value rules. Every present contract guarantees at most 4 ULP for both S and D, corresponding to at least 21 and 50 worst-case relative precision bits respectively for nonzero normal results. CPUID may advertise a smaller certified bound. Each instruction names its required FPTRANSA_ACCURACY contract. A clear PRESENT for that contract raises INVALID_OPERAND_RELATION before the instruction reads operands or floating-point state. An approximate transcendental operation is available only when CPUID reports FPTRANSA and marks that instruction's accuracy-contract ID present.

FPTRANSA applies DAZ before forming the exact reference input and measures its advertised ULP error before FTZ. It ignores FSTATUS.RM and formats its implementation-defined approximation with nearest-even rounding. The same implementation, input, format, and relevant FSTATUS mode produce a deterministic approximation. Different implementations may produce different bit patterns within the applicable accuracy contract.

A signaling NaN generates NV. NaN results are quieted and then processed by FSTATUS.DN. FSTATUS.FTZ replaces a subnormal result with the required signed zero and generates UF. Each instruction generates NV and DZ according to its special-value rules, and generates OF and UF when required by its exact result; NX is never generated, remains unchanged in FFLAGS, and cannot cause the FLOATING_POINT_EXCEPTION architectural event. Overflow means that the exact result magnitude exceeds the selected format's maximum finite value. Underflow means that the exact nonzero result magnitude is below the selected format's minimum normal value. If any generated floating-point exception cause has its matching FSTATUS enable bit set, the instruction raises the FLOATING_POINT_EXCEPTION architectural event before writing any destination. Otherwise it commits its result or results and accrues the generated causes in FFLAGS as one architectural commit.