NLAlib.Computation.abs_sub_binaryFloatRound_le
Library · theorem
Rounding with precision p and smallest exponent e_{\min} errs by at most 2^{-p}\max(\lvert \mathbf{x}\rvert, 2^{e_{\min} + p - 1}): relative error 2^{-p} above the smallest normal number 2^{e_{\min} + p - 1} and absolute error half the subnormal spacing below it. The selector may choose either neighbor at a tie. [Higham2002, §2.2], with gradual underflow as a floor.
NLAlib.Computation.abs_sub_binaryFloatRound_le (fmt : Float.Model.Format) {r : ℝ → ℤ}
(hr : ∀ (x : ℝ), Computation.AbsRelErr 0 (1 / 2) x ↑(r x)) (x : ℝ) :
|x - Computation.binaryFloatRound fmt r x| ≤
2⁻¹ ^ fmt.mantissaBits * max |x| (2 ^ (fmt.minExponent + ↑fmt.mantissaBits - 1))Import NLAlib.Matrix.FinitePrecision.BinaryFloat.