Native binary32 square root #
Positive finite inputs are scaled to a 47- or 48-bit radicand, so the exact floor square root and
the nearest-even decision fit in UInt64. Around the kernel, sqrt keeps the IEEE NaN, infinity,
negative-input and signed-zero behavior. Sqrt.Proof has the proofs.
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.Model.NativeBinary32.sqrtPositiveFiniteCore
(mantissa scale : UInt64)
:
Round the square root of a positive finite binary32 mantissa and scale.
For 0 < mantissa < 2^24 and scale ≤ 253, the input value is
mantissa * 2^(scale - 149), with subtraction in Int. The selected shift places its square root
in the 24-bit binary32 significand range before the final nearest-even decision.
Instances For
@[inline]
def
FloatLib.Floats.Formats.BinaryInterchange.Model.NativeBinary32.sqrtPositiveFinite
(exponent fraction : UInt32)
:
Decode binary32 fields and run the bounded positive-finite square-root kernel.
Instances For
@[inline]
Native binary32 square root, including IEEE exceptional-value behavior.