(** Divisions that can be turned into multiplication by an inverse. *)

Definition exact_inverse : float32 -> option float32 := Bexact_inverse 24 128 __ __.

(* Specifications: *)
Theorem div_mul_inverse: forall x y z, exact_inverse y = Some z -> div x y = mul x z.
Theorem cmp_swap: forall c x y, cmp (swap_comparison c) x y = cmp c y x.
Theorem cmp_ne_eq: forall f1 f2, cmp Cne f1 f2 = negb (cmp Ceq f1 f2).
Theorem cmp_lt_eq_false: forall f1 f2, cmp Clt f1 f2 = true -> cmp Ceq f1 f2 = true -> False.
Theorem cmp_le_lt_eq: forall f1 f2, cmp Cle f1 f2 = cmp Clt f1 f2 || cmp Ceq f1 f2.
Theorem cmp_gt_eq_false: forall x y, cmp Cgt x y = true -> cmp Ceq x y = true -> False.
Theorem cmp_ge_gt_eq: forall f1 f2, cmp Cge f1 f2 = cmp Cgt f1 f2 || cmp Ceq f1 f2.
Theorem cmp_lt_gt_false: forall f1 f2, cmp Clt f1 f2 = true -> cmp Cgt f1 f2 = true -> False.
Theorem cmp_double: forall f1 f2 c, cmp c f1 f2 = Float.cmp c (to_double f1) (to_double f2).
Theorem of_to_bits: forall f, of_bits (to_bits f) = f.
Theorem to_of_bits: forall b, to_bits (of_bits b) = b.
Theorem of_int_double: forall n, of_int n = of_double (Float.of_int n).
Theorem of_intu_double: forall n, of_intu n = of_double (Float.of_intu n).
Theorem to_int_double: forall f n, to_int f = Some n -> Float.to_int (to_double f) = Some n.
Theorem to_intu_double: forall f n, to_intu f = Some n -> Float.to_intu (to_double f) = Some n.
Theorem to_long_double: forall f n, to_long f = Some n -> Float.to_long (to_double f) = Some n.
Theorem to_longu_double: forall f n, to_longu f = Some n -> Float.to_longu (to_double f) = Some n.
Lemma int_round_odd_plus: forall p n, 0 <= p -> int_round_odd n p = Z.land (Z.lor n (Z.land n (2^p-1) + (2^p-1))) (-(2^p)).
Lemma of_long_round_odd: forall n conv_nan, 2^36 <= Z.abs n < 2^64 -> BofZ 24 128 __ __ n = Bconv _ _ 24 128 __ __ conv_nan mode_NE (BofZ 53 1024 __ __ (Z.land (Z.lor n ((Z.land n 2047) + 2047)) (-2048))).
Theorem of_longu_double_1: forall n, Int64.unsigned n <= 2^53 -> of_longu n = of_double (Float.of_longu n).
Theorem of_longu_double_2: forall n, 2^36 <= Int64.unsigned n -> of_longu n = of_double (Float.of_longu (Int64.and (Int64.or n (Int64.add (Int64.and n (Int64.repr 2047)) (Int64.repr 2047))) (Int64.repr (-2048)))).
Theorem of_long_double_1: forall n, Z.abs (Int64.signed n) <= 2^53 -> of_long n = of_double (Float.of_long n).
Theorem of_long_double_2: forall n, 2^36 <= Z.abs (Int64.signed n) -> of_long n = of_double (Float.of_long (Int64.and (Int64.or n (Int64.add (Int64.and n (Int64.repr 2047)) (Int64.repr 2047))) (Int64.repr (-2048)))).
Theorem div_mul_inverse: forall x y z, exact_inverse y = Some z -> div x y = mul x z.
Theorem cmp_swap: forall c x y, cmp (swap_comparison c) x y = cmp c y x.
Theorem cmp_ne_eq: forall f1 f2, cmp Cne f1 f2 = negb (cmp Ceq f1 f2).
Theorem cmp_lt_eq_false: forall f1 f2, cmp Clt f1 f2 = true -> cmp Ceq f1 f2 = true -> False.
Theorem cmp_le_lt_eq: forall f1 f2, cmp Cle f1 f2 = cmp Clt f1 f2 || cmp Ceq f1 f2.
Theorem cmp_gt_eq_false: forall x y, cmp Cgt x y = true -> cmp Ceq x y = true -> False.
Theorem cmp_ge_gt_eq: forall f1 f2, cmp Cge f1 f2 = cmp Cgt f1 f2 || cmp Ceq f1 f2.
Theorem cmp_lt_gt_false: forall f1 f2, cmp Clt f1 f2 = true -> cmp Cgt f1 f2 = true -> False.
Theorem cmp_double: forall f1 f2 c, cmp c f1 f2 = Float.cmp c (to_double f1) (to_double f2).
Theorem of_to_bits: forall f, of_bits (to_bits f) = f.
Theorem to_of_bits: forall b, to_bits (of_bits b) = b.
Theorem of_int_double: forall n, of_int n = of_double (Float.of_int n).
Theorem of_intu_double: forall n, of_intu n = of_double (Float.of_intu n).
Theorem to_int_double: forall f n, to_int f = Some n -> Float.to_int (to_double f) = Some n.
Theorem to_intu_double: forall f n, to_intu f = Some n -> Float.to_intu (to_double f) = Some n.
Theorem to_long_double: forall f n, to_long f = Some n -> Float.to_long (to_double f) = Some n.
Theorem to_longu_double: forall f n, to_longu f = Some n -> Float.to_longu (to_double f) = Some n.
Lemma int_round_odd_plus: forall p n, 0 <= p -> int_round_odd n p = Z.land (Z.lor n (Z.land n (2^p-1) + (2^p-1))) (-(2^p)).
Lemma of_long_round_odd: forall n conv_nan, 2^36 <= Z.abs n < 2^64 -> BofZ 24 128 __ __ n = Bconv _ _ 24 128 __ __ conv_nan mode_NE (BofZ 53 1024 __ __ (Z.land (Z.lor n ((Z.land n 2047) + 2047)) (-2048))).
Theorem of_longu_double_1: forall n, Int64.unsigned n <= 2^53 -> of_longu n = of_double (Float.of_longu n).
Theorem of_longu_double_2: forall n, 2^36 <= Int64.unsigned n -> of_longu n = of_double (Float.of_longu (Int64.and (Int64.or n (Int64.add (Int64.and n (Int64.repr 2047)) (Int64.repr 2047))) (Int64.repr (-2048)))).
Theorem of_long_double_1: forall n, Z.abs (Int64.signed n) <= 2^53 -> of_long n = of_double (Float.of_long n).
Theorem of_long_double_2: forall n, 2^36 <= Z.abs (Int64.signed n) -> of_long n = of_double (Float.of_long (Int64.and (Int64.or n (Int64.add (Int64.and n (Int64.repr 2047)) (Int64.repr 2047))) (Int64.repr (-2048)))).