NLA-lib Explorer

NLAlib.Ops.Examples.FixedPoint.abs_decode_quantize_sub_le

Library · theorem

In-range quantization has absolute error at most half a grid spacing.

NLAlib.Ops.Examples.FixedPoint.abs_decode_quantize_sub_le (bound scale : ℕ) (hs : 0 < scale) {x : ℝ}
  (hx : |x| ≤ ↑bound / ↑scale) :
  |Ops.Examples.FixedPoint.decode scale (Ops.Examples.FixedPoint.quantize bound scale x) - x| ≤
    1 / 2 / ↑scale

Full source on GitHub

Import NLAlib.Ops.Examples.FixedPoint.