End Double_round_sqrt_beta_ge_4_FTZ.
End Double_round_sqrt_beta_ge_4.
End Double_round_sqrt.
Section Double_round_div.

(* Specifications: *)
Lemma double_round_eq_mid_beta_even :
forall (fexp1 fexp2 : Z -> Z),
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
(exists n, (beta = 2 * n :> Z)%Z) ->
forall x,
0 < x ->
(fexp2 (ln_beta x) <= fexp1 (ln_beta x) - 1)%Z ->
(fexp1 (ln_beta x) <= ln_beta x)%Z ->
x = midp fexp1 x ->
double_round_eq fexp1 fexp2 choice1 choice2 x.
Lemma double_round_really_zero :
forall (fexp1 fexp2 : Z -> Z),
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
forall x,
0 < x ->
(ln_beta x <= fexp1 (ln_beta x) - 2)%Z ->
double_round_eq fexp1 fexp2 choice1 choice2 x.
Lemma double_round_zero :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
forall x,
0 < x ->
(fexp1 (ln_beta x) = ln_beta x + 1 :> Z)%Z ->
x < bpow (ln_beta x) - / 2 * ulp beta fexp2 x ->
double_round_eq fexp1 fexp2 choice1 choice2 x.
Lemma double_round_all_mid_cases :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
forall x,
0 < x ->
(fexp2 (ln_beta x) <= fexp1 (ln_beta x) - 1)%Z ->
((fexp1 (ln_beta x) = ln_beta x + 1 :> Z)%Z ->
bpow (ln_beta x) - / 2 * ulp beta fexp2 x <= x ->
double_round_eq fexp1 fexp2 choice1 choice2 x) ->
((fexp1 (ln_beta x) <= ln_beta x)%Z ->
midp fexp1 x - / 2 * ulp beta fexp2 x <= x < midp fexp1 x ->
double_round_eq fexp1 fexp2 choice1 choice2 x) ->
((fexp1 (ln_beta x) <= ln_beta x)%Z ->
x = midp fexp1 x ->
double_round_eq fexp1 fexp2 choice1 choice2 x) ->
((fexp1 (ln_beta x) <= ln_beta x)%Z ->
midp fexp1 x < x <= midp fexp1 x + / 2 * ulp beta fexp2 x ->
double_round_eq fexp1 fexp2 choice1 choice2 x) ->
double_round_eq fexp1 fexp2 choice1 choice2 x.
Lemma ln_beta_div_disj :
forall x y : R,
0 < x -> 0 < y ->
((ln_beta (x / y) = ln_beta x - ln_beta y :> Z)%Z
\/ (ln_beta (x / y) = ln_beta x - ln_beta y + 1 :> Z)%Z).