Correctness of native one-word finite addition #
Under Eligible, every accepted result of Add.Runtime agrees with the exact finite kernel.
addFinite_refines also covers subtraction by identifying the toggled right sign with neg y.
A declined input is handled by the dispatcher's generic fallback.
normalSpec? describes the normal branch of FiniteProductRound.round. The proof transfers
native rounding to this specification using the shared carry and packing theorem
NativeWordProduct.finish_eq, then treats signed magnitudes, exponent alignment, and decoding.
Natural-number specification of the normal rounding path #
The normal branch of FiniteProductRound.round, declining instead of producing a subnormal or an
infinite result.
For a nonzero magnitude, this rounds the value with sign sign and magnitude
magnitude * 2 ^ (scale - 2 * ieeeSubnormalAlignExp fmt), interpreting subtraction in Int.
normalSpec_refines identifies each accepted answer with the total product rounder.
Instances For
A some answer of the normal specification is the arbitrary-precision rounder's result.
Machine-word rounding #
The alignment offset is exact when expWidth ≤ 30 and fracWidth ≤ 61.
The alignment shift limit is exact when fracWidth ≤ 61.
The machine-word rounder computes the natural-number normal specification.
The magnitude is nonzero and the scale is bounded by the exponent range, so no intermediate position, shift, or increment wraps around the word.
An accepted machine-word rounding is the unsigned-scale rounding of the exact kernel.
Signed magnitudes and alignment #
An accepted aligned combination is the exact kernel's signed-magnitude combination.
The machine-word finite scale is the compact finite scale of the exact kernel.
An accepted field addition is the exact unsigned-scale sum of the same fields.
The exponent bounds keep every scale below 2 ^ 31 and the significand bounds keep the aligned
same-sign sum below 2 ^ 64, which is all the machine-word transfer needs.
Storage-word decoding #
The generic finite decoder sees the fields the one-word kernel extracts from a finite word.
Negating a finite word keeps its exponent and fraction fields and toggles its sign.
The exponent field of a one-word value is a stored exponent.
The finite significand of a one-word value has at most fracWidth + 1 bits.
An accepted one-word addition, or subtraction, is the exact compact finite kernel's answer.
negateRight selects subtraction: the kernel toggled the right sign in machine words, and the
theorem states the corresponding claim about neg y. Every decline is outside the statement; the
dispatcher uses the exact implementation for it. The hypothesis is the kernel's own capacity
contract Eligible: IEEE encoding, at most 64 total bits, at most 30 exponent bits, and at most
61 fraction bits.