(* This file was originally generated by why.
   It can be modified; only the generated parts will be overwritten. *)

Require Export Sterbenz_spec_why.
Require Export WhyFloats.

(* Why obligation from file "/users/demons/ayad/ppc/why/examples-c/float/Sterbenz.c", line 3, characters 4-18: *)
(*Why goal*) Lemma Sterbenz_impl_po_1 : 
  forall (x: single),
  forall (y: single),
  forall (HW_1: (* CADUCEUS_1 *)
                ((Rle (Rdiv (s_to_r y) (IZR 2)) (s_to_r x)) /\
                (Rle (s_to_r x) (Rmult (IZR 2) (s_to_r y))))),
  (* CADUCEUS_2 *)
  (eq (s_to_r (sub_single nearest_even x y)) (Rminus (s_to_r x) (s_to_r y))).
Proof.
intros x y; unfold s_to_r; destruct x; destruct y;simpl.
intros.
apply trans_eq with (FtoRradix (Fminus radix sf sf0)).
unfold FtoRradix; apply sym_eq.
apply RoundedModeProjectorIdemEq with bsingle 24%nat (EvenClosest bsingle radix 24); auto with zarith.
apply Sterbenz; auto with zarith real.
elim HW_1; intros H1 H2; fold FtoRradix; apply Rle_trans with (2:=H1).
simpl; right; unfold Rdiv; auto with real.
elim HW_1; intros H1 H2; fold FtoRradix; apply Rle_trans with (1:=H2).
simpl; right; auto with real.
rewrite Fminus_correct; auto with zarith.
unfold FtoRradix; rewrite Fminus_correct; auto with zarith real.
Save.

