Exact rational arithmetic for P3109 #
The closed operations in Arithmetic evaluate finite operands in Rat, retaining infinities
and the report's single NaN. In particular, division by zero returns NaN, including infinity
divided by zero. FMA and fused add-add form the complete exact expression before projection.
The ExecFloat.P3109.*To operations accept independent source and destination descriptors and
an explicit projection policy. Same-format operations use FloatLib's nearest-even,
no-saturation policy by default. No IEEE exception flags or floating-point environment are used.
Exact rational intermediates can require large integers when the descriptor has a wide exponent range. This implementation does not promise a fixed workspace bound for arbitrary descriptors.
Reference #
IEEE Working Group P3109, Interim Report on Arithmetic Formats for Machine Learning,
version 4.0.3 (1 September 2026), §§4.10.1–4.10.8, revision 34f5964.
This is an unapproved working-group report, not an approved IEEE standard.
https://github.com/P3109/Public/tree/34f5964d9bb2382b2665d15467fc3517b990b308.
The report's single exceptional datum.
Instances For
Exact rational observation of a decoded binary datum.
Instances For
Negation in the report's closed extended domain.
Instances For
Absolute value in the report's closed extended domain.
Instances For
Copying a sign treats zero as nonnegative and propagates either NaN operand.
Instances For
Exact addition; opposite infinities have the indeterminate result NaN.
Instances For
Exact subtraction, with no projection of the negated operand.
Instances For
Exact multiplication; zero times infinity is NaN.
Instances For
Exact division; every zero denominator and infinity divided by infinity yield NaN.
Instances For
Exact reciprocal, before the sole destination projection.
Instances For
Exact fused multiply-add, with no intermediate rounding or saturation.
Instances For
Exact fused add-add, with no intermediate rounding or saturation.
Instances For
Exact closed rational value of a P3109 operand.
Instances For
Project an exact unary closed operation into an independently chosen destination.
Instances For
Project an exact binary closed operation once, after evaluating both operands.
Instances For
Project an exact ternary closed operation once, after the complete expression.
Instances For
Negate and project into the requested destination.
Instances For
Take absolute value and project into the requested destination.
Instances For
Copy the sign, propagating either NaN, and project once.
Instances For
Add exact decoded operands and project once.
Instances For
Subtract exact decoded operands and project once.
Instances For
Multiply exact decoded operands and project once.
Instances For
Divide exact decoded operands, returning NaN for a zero denominator, and project once.
Instances For
Take the exact reciprocal and project once.
Instances For
Fused multiply-add across independently chosen source and destination formats.
Instances For
Fused add-add across independently chosen source and destination formats.
Instances For
Same-format negation followed by the supplied projection.
Instances For
Same-format absolute value followed by the supplied projection.
Instances For
Same-format sign copying followed by the supplied projection.
Instances For
Same-format addition with one final projection.
Instances For
Same-format subtraction with one final projection.
Instances For
Same-format multiplication with one final projection.
Instances For
Same-format division with one final projection; a zero denominator yields NaN.
Instances For
Same-format reciprocal with one final projection.
Instances For
Same-format fused multiply-add with one final projection.
Instances For
Same-format fused add-add with one final projection.