Correctness of signed-magnitude dyadic addition #
The runtime aligns dyadic significands and adds their natural-number magnitudes with separate
signs. addDyadicImpl_eq identifies this implementation with exact dyadic addition, including
cancellation and the signed-zero rule.
The @[csimp] theorem addDyadic_eq_addDyadicImpl supplies the equality used by the compiler
substitution. The remaining public lemmas describe equal- and adjacent-exponent cases used by
native arithmetic refinements.
Subtract equal-exponent dyadic magnitudes when the left operand has the larger magnitude.
Opposite signs turn addition into exact subtraction; the result keeps the sign of the larger magnitude and needs no rounding or exponent adjustment.
Subtract equal-exponent dyadic magnitudes when the right operand has the larger magnitude.
Opposite-sign subtraction with the larger left operand one exponent higher.
Opposite-sign subtraction with the larger right operand one exponent higher.
Align the right dyadic magnitude to the left exponent without changing the exact sum.
Align the left dyadic magnitude to the right exponent without changing the exact sum.
Signed-magnitude dyadic addition is equal to the public exact definition.
Exact dyadic addition is commutative, including its signed-zero rule.
Compile exact dyadic addition through the verified signed-magnitude implementation.