NLA-lib Explorer

Real.abs_sub_roundNearest_le

Library · theorem

The rounding error bound [Higham2002, Theorem 2.2]: rounding to nearest onto the grid with t significant bits has relative error at most u = 2^{-t}, \lvert \mathbf{x} - \mathrm{fl}(\mathbf{x}) \rvert \le 2^{-t} \lvert \mathbf{x} \rvert.

Real.abs_sub_roundNearest_le (t : ℕ) (x : ℝ) : |x - Real.roundNearest t x| ≤ 2⁻¹ ^ t * |x|

Full source on GitHub

Import NLAlib.ForMathlib.Algebra.Order.Round.