Definition double_round_div_hyp fexp1 fexp2 :=
(forall ex, (fexp2 ex <= fexp1 ex - 1)%Z)
/\ (forall ex ey, (fexp1 ex < ex)%Z -> (fexp1 ey < ey)%Z ->
(fexp1 (ex - ey) <= ex - ey + 1)%Z ->
(fexp2 (ex - ey) <= fexp1 ex - ey)%Z)
/\ (forall ex ey, (fexp1 ex < ex)%Z -> (fexp1 ey < ey)%Z ->
(fexp1 (ex - ey + 1) <= ex - ey + 1 + 1)%Z ->
(fexp2 (ex - ey + 1) <= fexp1 ex - ey)%Z)
/\ (forall ex ey, (fexp1 ex < ex)%Z -> (fexp1 ey < ey)%Z ->
(fexp1 (ex - ey) <= ex - ey)%Z ->
(fexp2 (ex - ey) <= fexp1 (ex - ey)
+ fexp1 ey - ey)%Z)
/\ (forall ex ey, (fexp1 ex < ex)%Z -> (fexp1 ey < ey)%Z ->
(fexp1 (ex - ey) = ex - ey + 1)%Z ->
(fexp2 (ex - ey) <= ex - ey - ey + fexp1 ey)%Z).

(* Specifications: *)
Lemma double_round_div_aux0 :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
double_round_div_hyp fexp1 fexp2 ->
forall x y,
0 < x -> 0 < y ->
generic_format beta fexp1 x ->
generic_format beta fexp1 y ->
fexp1 (ln_beta (x / y)) = (ln_beta (x / y) + 1)%Z ->
~ (bpow (ln_beta (x / y)) - / 2 * ulp beta fexp2 (x / y) <= x / y).
Lemma double_round_div_aux1 :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
double_round_div_hyp fexp1 fexp2 ->
forall x y,
0 < x -> 0 < y ->
generic_format beta fexp1 x ->
generic_format beta fexp1 y ->
(fexp1 (ln_beta (x / y)) <= ln_beta (x / y))%Z ->
~ (midp fexp1 (x / y) - / 2 * ulp beta fexp2 (x / y)
<= x / y
< midp fexp1 (x / y)).
Lemma double_round_div_aux2 :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
double_round_div_hyp fexp1 fexp2 ->
forall x y,
0 < x -> 0 < y ->
generic_format beta fexp1 x ->
generic_format beta fexp1 y ->
(fexp1 (ln_beta (x / y)) <= ln_beta (x / y))%Z ->
~ (midp fexp1 (x / y)
< x / y
<= midp fexp1 (x / y) + / 2 * ulp beta fexp2 (x / y)).
Lemma double_round_div_aux :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
(exists n, (beta = 2 * n :> Z)%Z) ->
double_round_div_hyp fexp1 fexp2 ->
forall x y,
0 < x -> 0 < y ->
generic_format beta fexp1 x ->
generic_format beta fexp1 y ->
double_round_eq fexp1 fexp2 choice1 choice2 (x / y).
Lemma double_round_div :
forall fexp1 fexp2 : Z -> Z,
Valid_exp fexp1 -> Valid_exp fexp2 ->
forall (choice1 choice2 : Z -> bool),
(exists n, (beta = 2 * n :> Z)%Z) ->
double_round_div_hyp fexp1 fexp2 ->
forall x y,
y <> 0 ->
generic_format beta fexp1 x ->
generic_format beta fexp1 y ->
double_round_eq fexp1 fexp2 choice1 choice2 (x / y).