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

(* Specifications: *)
Lemma double_round_sqrt_beta_ge_4_aux : (4 <= beta)%Z -> forall fexp1 fexp2 : Z -> Z, Valid_exp fexp1 -> Valid_exp fexp2 -> double_round_sqrt_beta_ge_4_hyp fexp1 fexp2 -> forall x, 0 < x -> (fexp2 (ln_beta (sqrt x)) <= fexp1 (ln_beta (sqrt x)) - 1)%Z -> generic_format beta fexp1 x -> / 2 * ulp beta fexp2 (sqrt x) < Rabs (sqrt x - midp fexp1 (sqrt x)).
Lemma double_round_sqrt_beta_ge_4 : (4 <= beta)%Z -> forall fexp1 fexp2 : Z -> Z, Valid_exp fexp1 -> Valid_exp fexp2 -> forall (choice1 choice2 : Z -> bool), double_round_sqrt_beta_ge_4_hyp fexp1 fexp2 -> forall x, generic_format beta fexp1 x -> double_round_eq fexp1 fexp2 choice1 choice2 (sqrt x).
Lemma FLX_double_round_sqrt_beta_ge_4_hyp : (2 * prec + 1 <= prec')%Z -> double_round_sqrt_beta_ge_4_hyp (FLX_exp prec) (FLX_exp prec').
Theorem double_round_sqrt_beta_ge_4_FLX : (4 <= beta)%Z -> forall choice1 choice2, (2 * prec + 1 <= prec')%Z -> forall x, FLX_format beta prec x -> double_round_eq (FLX_exp prec) (FLX_exp prec') choice1 choice2 (sqrt x).
Lemma FLT_double_round_sqrt_beta_ge_4_hyp : (emin <= 0)%Z -> ((emin' <= emin - prec - 1)%Z \/ (2 * emin' <= emin - 4 * prec)%Z) -> (2 * prec + 1 <= prec')%Z -> double_round_sqrt_beta_ge_4_hyp (FLT_exp emin prec) (FLT_exp emin' prec').
Theorem double_round_sqrt_beta_ge_4_FLT : (4 <= beta)%Z -> forall choice1 choice2, (emin <= 0)%Z -> ((emin' <= emin - prec - 1)%Z \/ (2 * emin' <= emin - 4 * prec)%Z) -> (2 * prec + 1 <= prec')%Z -> forall x, FLT_format beta emin prec x -> double_round_eq (FLT_exp emin prec) (FLT_exp emin' prec') choice1 choice2 (sqrt x).
Lemma FTZ_double_round_sqrt_beta_ge_4_hyp : (2 * (emin' + prec') <= emin + prec <= 1)%Z -> (2 * prec + 1 <= prec')%Z -> double_round_sqrt_beta_ge_4_hyp (FTZ_exp emin prec) (FTZ_exp emin' prec').
Theorem double_round_sqrt_beta_ge_4_FTZ : (4 <= beta)%Z -> forall choice1 choice2, (2 * (emin' + prec') <= emin + prec <= 1)%Z -> (2 * prec + 1 <= prec')%Z -> forall x, FTZ_format beta emin prec x -> double_round_eq (FTZ_exp emin prec) (FTZ_exp emin' prec') choice1 choice2 (sqrt x).
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).