NLA-lib Explorer

NLAlib.isRoundingOf_binaryFloatRound

Library · theorem

Bounded-format rounding is a rounding with floor: rounding to the binary format fmt with gradual underflow (NLAlib.Computation.binaryFloatRound, any nearest tie rule) returns a rounding of every real a in the sense of NLAlib.IsRoundingOf with unit roundoff 2^{-p}, floor \tau = 2^{e_{\min} + p - 1} (the smallest normal number) and range the largest finite number, p the precision and e_{\min} the smallest exponent. In the normal range the error is relative; below it, half the subnormal spacing, 2^{e_{\min}}/2 = 2^{-p}\tau, so no factor is lost against the mixed form NLAlib.Computation.AbsRelErr. [Higham2002, §2.2], with gradual underflow.

NLAlib.isRoundingOf_binaryFloatRound (fmt : Float.Model.Format) {r : ℝ → ℤ}
  (hr : ∀ (x : ℝ), Computation.AbsRelErr 0 (1 / 2) x ↑(r x)) (a : ℝ) :
  IsRoundingOf (2⁻¹ ^ fmt.mantissaBits) (2 ^ (fmt.minExponent + ↑fmt.mantissaBits - 1))
    fmt.maxFinite a (Computation.binaryFloatRound fmt r a)

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.EntrywiseRounding.