Rounding Rationals to Floating-Point Representations #
This module defines normalization of a FloatRep, the roundDown/roundf
rounding maps from rationals to representations under an IntRounder, and the
correctness and error-bound results (such as roundf_close) controlling the
distance between a rational and its rounded floating-point value.
theorem
round_symmetry₁
{C : FloatCfg}
(P : IntRounder → FloatRep C → Prop)
(h1 : ∀ (r : IntRounder) (f : FloatRep C), P r.neg f.neg → P r f)
(h2 : ∀ (r : IntRounder) (e : ℤ) (m : ℕ), P r { s := false, e := e, m := m })
(r : IntRounder)
(f : FloatRep C)
:
P r f
theorem
roundf_coe
{C : FloatCfg}
(r : IntRounder)
[rh : ValidRounder r]
(f : FloatRep C)
(h : f.validM)
:
theorem
le_roundf_of_le
{C : FloatCfg}
(r : IntRounder)
[rh : ValidRounder r]
(q1 q2 : ℚ)
(q1_nezero : q1 ≠ 0)
(q2_nezero : q2 ≠ 0)
:
The IntRounder selected by the rounding mode in scope.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
roundf_min_abs_e
{C : FloatCfg}
(r : IntRounder)
[rh : ValidRounder r]
{q : ℚ}
(h : q ≠ 0)
:
theorem
roundf_in_range
{C : FloatCfg}
(r : IntRounder)
[rh : ValidRounder r]
{q : ℚ}
(q_nezero : q ≠ 0)
(h : |q| ≤ maxFloatQ C)
: