Verified wide-limb addition and subtraction #
The central theorem is alignOrdered?_refines: an accepted result of the alignment core is the
unsigned-scale exact sum FiniteScaleAdd.roundSum of the two signed magnitudes. Its proof follows
the two routes of the kernel. On the jammed route the limb value of the combined significand is
shiftRightJam of the exact aligned sum or difference (shiftRightJam_add_mul_two_pow,
shiftRightJam_mul_two_pow_sub), and the exact value has enough bits above the jam for
roundNormal?_jammed. On the exact route the limb value is the exact sum or difference and
roundNormal?_exact applies. Equal magnitudes of opposite sign give positive zero, as the
specification requires.
addNormal?_refines decodes two normal stored values into the core and identifies the result with
FiniteKernel.add?, and toModel_add and toModel_sub finish with the reference operations.
Rounding helpers #
An accepted rounding of an exact significand is the exact rounder.
An accepted rounding of a jammed significand is the exact rounder on the exact value.
The alignment core #
Packing a zero significand with a clear sign bit gives positive zero.
A zero with a false sign bit is positive zero.
An accepted result of the ordered alignment core is the unsigned-scale exact sum of its operands.
An accepted result of the alignment core is the unsigned-scale exact sum of its operands.
Addition and subtraction of stored values #
A normal stored value decodes to its sign, exponent field, and normal significand.
Decoding a normal stored value, possibly negated, flips its sign when negate is set.
An accepted normal sum is the compact finite addition of the operand models.