Verified wide-limb normal rounding #
The proof proceeds through a natural-number specification roundJammed, which restates the normal
branch of FiniteProductRound.round for a significand whose jam low bits have been jammed into
one sticky bit. Two theorems connect it to its neighbours.
roundNormal?_map_toModel: the limb kernel computesroundJammedon the value of its nonzero significand, assuming the exponent field fits in 32 bits.round_eq_of_roundJammed: an acceptedroundJammedresult on the jammed value is the exact rounderFiniteProductRound.roundon the exact value, byroundShiftRightEven_shiftRightJam.
Together they let each arithmetic kernel prove toModel result = FiniteProductRound.round ... and
then reuse the generic kernel's own refinement theorems.
The natural-number specification #
The normal branch of FiniteProductRound.round for a jammed significand.
For a sufficiently large exact value, significand = shiftRightJam exact jam has its leading bit
jam positions below that of exact. round_eq_of_roundJammed states the required bound;
roundNormal?_map_toModel relates this specification to the limb kernel on nonzero inputs.
Instances For
Bounds on the rounded significand #
Rounding a nonzero value to fracWidth + 1 bits lands in [2^fracWidth, 2^(fracWidth + 1)].
The limb kernel computes the specification #
An accepted limb rounding is the natural-number specification on the significand's value.
The specification refines the exact rounder #
shiftRightJam by zero bits is the identity.
An accepted roundJammed result on shiftRightJam exact jam is the exact rounder on exact.
The hypothesis 2 ^ (fracWidth + jam + 2) ≤ exact (vacuous for jam = 0) is what
roundShiftRightEven_shiftRightJam needs: at least the guard bit and one more bit of the rounded
quotient lie above the jammed position.