proposition: Theorem Bmult_correct : forall m x y, if Rlt_bool (Rabs (round radix2 fexp (round_mode m) (B2R x * B2R y))) (bpow radix2 emax) then B2R (Bmult m x y) = round radix2 fexp (round_mode m) (B2R x * B2R y) /\ is_finite (Bmult m x y) = andb (is_finite x) (is_finite y) /\ (is_nan (Bmult m x y) = false -> Bsign (Bmult m x y) = xorb (Bsign x) (Bsign y)) else B2SF (Bmult m x y) = binary_overflow m (xorb (Bsign x) (Bsign y)).
proof: Proof. intros m [sx|sx| |sx mx ex Hx] [sy|sy| |sy my ey Hy] ; try ( rewrite ?Rmult_0_r, ?Rmult_0_l, round_0, Rabs_R0, Rlt_bool_true ; [ simpl ; try easy ; now rewrite B2R_build_nan, is_finite_build_nan, is_nan_build_nan | apply bpow_gt_0 | now auto with typeclass_instances ] ). simpl. case Bmult_correct_aux. intros H1. case Rlt_bool. intros (H2, (H3, H4)). split. now rewrite B2R_SF2B. split. now rewrite is_finite_SF2B. rewrite Bsign_SF2B. auto. intros H2. now rewrite B2SF_SF2B. Qed.
imports: Coq(ZArith Reals Psatz SpecFloat) Core Round Bracket Operations Div Sqrt Relative