Executable exact-dyadic arithmetic #
These routines compute exact multiplication, addition, subtraction, and fused multiply-add before any target-format rounding occurs. Record entry points are convenient in specifications; matching field-level entry points let packed decoders reuse the same semantics without constructing short-lived input records.
The representation is not normalized after every operation. Alignment uses the smaller exponent,
which leaves normalization to the target-format rounder. Proof establishes that the field-level
operations agree with their record-based counterparts and preserve rational denotation.
Exact product from scalar dyadic fields.
Packed decoders expose these fields individually. Keeping this operation below the record boundary lets verified execution kernels avoid allocating two short-lived input records while returning the same single exact result consumed by rounding.
Instances For
Exact product of two dyadic values.
Instances For
Exact addition from scalar dyadic fields by alignment at the smaller exponent.
If the mathematical sum is zero, the result retains a negative sign only when both operands were negative. This agrees with the usual nearest-even signed-zero convention while remaining harmless for formats, such as posits, that have a unique zero.
Instances For
Exact addition of two dyadic values.
Instances For
Exact subtraction, expressed through exact negation and addition.
Instances For
Exact fused multiply-add from scalar dyadic fields.
The product is never rounded before addition. Only the single returned exact dyadic is intended to cross into a format-specific rounder.