Native binary64 square-root runtime #
Positive finite inputs are scaled to a 105- or 106-bit radicand held in two UInt64 limbs. A
53-step restoring square-root loop computes the floor root and remainder using native words. The
remainder classifies the nearest-even result directly, after which the binary64 exponent and
fraction are packed without constructing a generic unpacked-float model.
Correctness proofs and the Nat.sqrt model are isolated in Sqrt.Proof.
Shift a binary64 significand into two limbs; callers supply a positive shift below 128 and a result that fits in 128 bits.
Instances For
Read a base-four digit of a two-limb radicand, for an index below 64.
Instances For
Consume one base-four digit in the restoring square-root recurrence.
For the binary64 radicands constructed above, 53 iterations produce a 53-bit floor root. The
remainder and trial divisor remain below one native word.
Instances For
Consume a requested number of radicand digits from most significant to least significant.
Instances For
Compute the floor root and exact remainder of a binary64-sized scaled radicand.
Instances For
Direct positive-finite binary64 square root.
For a nonzero significand below 2^53 and a scale at most 2045, the input value is
mantissa * 2^(scale - 1074), with subtraction in the exponent interpreted in Int. Parity
chooses a 105- or 106-bit integer radicand. Its square root cannot be a half-integer, so
remainder ≤ root is precisely the round-down condition.
Instances For
Decode binary64 fields and run the bounded positive-finite square-root kernel.
Instances For
Native binary64 square root, including IEEE exceptional-value behavior.