Implementation of floating-point numbers (experimental). #
Equations
- Int.shift2 a b (Int.ofNat e) = (a <<< e, b)
- Int.shift2 a b (Int.negSucc e) = (a, b <<< e.succ)
Instances For
Equations
- FP.instInhabitedRMode = { default := FP.RMode.NE }
Equations
- FP.decValidFinite e m = id inferInstance
- inf: [C : FP.FloatCfg] → Bool → FP.Float
- nan: [C : FP.FloatCfg] → FP.Float
- finite: [C : FP.FloatCfg] → Bool → (e : ℤ) → (m : ℕ) → FP.ValidFinite e m → FP.Float
Instances For
Equations
- (FP.Float.finite a e m a_1).isFinite = true
- x.isFinite = false
Instances For
Equations
- FP.toRat (FP.Float.finite s e m a) x_2 = match Int.shift2 m 1 e with | (n, d) => let r := mkRat (↑n) d; if s = true then -r else r
Instances For
Equations
- FP.Float.zero s = FP.Float.finite s FP.emin 0 ⋯
Instances For
Equations
- FP.instInhabitedFloat = { default := FP.Float.zero true }
Equations
- (FP.Float.inf s).sign' = pure s
- FP.Float.nan.sign' = ⊤
- (FP.Float.finite s e m a).sign' = pure s
Instances For
Equations
- (FP.Float.inf s).sign = s
- FP.Float.nan.sign = false
- (FP.Float.finite s e m a).sign = s
Instances For
Equations
- (FP.Float.finite a e 0 a_1).isZero = true
- x.isZero = false
Instances For
Equations
- (FP.Float.inf s).neg = FP.Float.inf !s
- FP.Float.nan.neg = FP.Float.nan
- (FP.Float.finite s e m a).neg = FP.Float.finite (!s) e m a
Instances For
Equations
- FP.divNatLtTwoPow n d (Int.ofNat e) = decide (n < d <<< e)
- FP.divNatLtTwoPow n d (Int.negSucc e) = decide (n <<< e.succ < d)
Instances For
Instances For
Instances For
Equations
- FP.Float.instNeg = { neg := FP.Float.neg }
Instances For
unsafe def
FP.Float.sub
[C : FP.FloatCfg]
(mode : FP.RMode)
(f1 : FP.Float)
(f2 : FP.Float)
:
FP.Float