Executable direct posit candidate generation #
Direct candidate generation constructs a proposed lower posit code from a normalized exact dyadic. It contains only executable field extraction and packing. The accompanying proof module records the field and range properties reused by the direct guard-and-sticky rounder.
Take the first count normalized fraction bits after the leading one.
leading is Nat.log2 significand. When more bits are requested than the integer significand
stores, the exact dyadic expansion is padded with zeros rather than converted through Rat.
Instances For
Take the first count bits of the standard exponent/fraction tail.
The Posit Standard (2022) fixes the maximum exponent field at two bits. Tapering removes its low bits first, so a short tail keeps the most-significant exponent bits. Any remaining positions are filled by the normalized dyadic fraction.
Instances For
Pack already normalized regime, exponent, and significand fields into the unsigned lower code.
Separating normalization from layout gives native-word and fixed-limb backends one common packing boundary. The function saturates above maxPos and truncates below minPos.
Instances For
Construct the unsigned lower posit candidate directly from a positive exact dyadic.
The function is total. Zero and negative carriers return zero; magnitudes above maxPos produce the all-ones positive payload; magnitudes below minPos produce zero. The public rounder handles the standard's nonzero-underflow-to-minPos rule before consulting this candidate.