(****************************************************************************  IEEE754  :  FSucc  Laurent Thery  ******************************************************************************)
Require Export List.
Require Export Fnorm.
Section suc.
Variable b : Fbound.
Variable radix : Z.
Variable precision : nat.
Let FtoRradix := FtoR radix.
Local Coercion FtoRradix : float >-> R.
Hypothesis radixMoreThanOne : (1 < radix)%Z.
Let radixMoreThanZERO := Zlt_1_O _ (Zlt_le_weak _ _ radixMoreThanOne).
Hint Resolve radixMoreThanZERO: zarith.
Hypothesis precisionNotZero : precision <> 0.
Hypothesis pGivesBound : Zpos (vNum b) = Zpower_nat radix precision.
Definition FSucc (x : float) :=
match Z_eq_bool (Fnum x) (pPred (vNum b)) with
| true => Float (nNormMin radix precision) (Zsucc (Fexp x))
| false =>
match Z_eq_bool (Fnum x) (- nNormMin radix precision) with
| true =>
match Z_eq_bool (Fexp x) (- dExp b) with
| true => Float (Zsucc (Fnum x)) (Fexp x)
| false => Float (- pPred (vNum b)) (Zpred (Fexp x))
end
| false => Float (Zsucc (Fnum x)) (Fexp x)
end
end.

Theorem FSuccSimpl1 :
forall x : float,
Fnum x = pPred (vNum b) ->
FSucc x = Float (nNormMin radix precision) (Zsucc (Fexp x)).