IEEE32Exec and FP32: Dyadic Rounding Helpers #
Exact dyadic addition (used by op-level refinement theorems) #
IEEE-754 addition is “exact add, then round”. To connect an executable add to the FP32 model, we
factor the refinement into two steps:
- perform an exact addition in an unbounded format (here: dyadics with integer exponents), and
- apply float32 rounding.
addDyadic is our exact step (it aligns exponents, adds signed mantissas, and normalizes), and the
lemmas in this section show that its real interpretation is literally real addition.
Instances For
addDyadic is exact with respect to dyadicToReal.
Informal: addDyadic aligns exponents, adds signed mantissas, and normalizes; decoding the result
gives the sum of the decoded inputs.
For a nonzero dyadic, neural_magnitude matches the expected “power-of-two interval”
characterization: mag = ⌊logb 2 (mant)⌋ + exp + 1.
We use this as a key link between the FP32 rounding model (defined using neural_magnitude) and
the executable kernel (which naturally computes Nat.log2 mant + exp from the decoded dyadic).