Commit f6759b30 by MARCHE Claude

### test floats

parent 6dfcf274
 theory TestGappa use import real.Real use import real.Abs use import real.Square use import floating_point.Rounding use floating_point.Single use import floating_point.Double goal Round_single_01: Single.round NearestTiesToEven 0.1 = 0x1.99999ap-4 goal Round_double_01: Double.round NearestTiesToEven 0.1 = 0x1.999999999999ap-4 goal Test00: forall x:real. abs x <= 2.0 -> -3.0 <= x goal Test01: forall x:double. -2.0 <= value x <= 2.0 -> abs((value x) * (value x) - round NearestTiesToEven ((value x) * (value x))) <= 0x1p-52 goal Test02: forall x y:double. abs (value x) <= 2.0 -> y = x -> abs((value y) * (value y) - round NearestTiesToEven ((value x) * (value x))) <= 0x1p-52 goal Test03: forall x y z:double. abs (value x) <= 2.0 -> value y = round NearestTiesToEven ((value x) * (value x)) -> z = y -> sqrt ((value z - (value x)*(value x))*(value y - (value x)*(value x))) <= 0x1p-52 end

 ... ... @@ -5,27 +5,34 @@ theory TestGappa use import real.Abs use import real.Square use import floating_point.Rounding use floating_point.Single use import floating_point.Double lemma Round_single_01: Single.round NearestTiesToEven 0.1 = 0x1.99999ap-4 lemma Round_double_01: Double.round NearestTiesToEven 0.1 = 0x1.999999999999ap-4 lemma Test00: forall x:real. abs x <= 2.0 -> -3.0 <= x lemma Test01: lemma Test01: forall x:double. -2.0 <= value x <= 2.0 -> abs((value x) * (value x) - abs((value x) * (value x) - round NearestTiesToEven ((value x) * (value x))) <= 0x1p-52 lemma Test02: lemma Test02: forall x y:double. abs (value x) <= 2.0 -> abs (value x) <= 2.0 -> y = x -> abs((value y) * (value y) - abs((value y) * (value y) - round NearestTiesToEven ((value x) * (value x))) <= 0x1p-52 lemma Test03: lemma Test03: forall x y z:double. abs (value x) <= 2.0 -> value y = round NearestTiesToEven ((value x) * (value x)) -> abs (value x) <= 2.0 -> value y = round NearestTiesToEven ((value x) * (value x)) -> z = y -> sqrt ((value z - (value x)*(value x))*(value y - (value x)*(value x))) <= 0x1p-52 ... ...
 ... ... @@ -81,19 +81,30 @@ theory GenFloat axiom Round_up_neg: forall x:real. round Up (-x) = - round Down x end theory GenFloatFull use import GenFloat use import SpecialValues (* special values *) function class t : class function sign t : sign predicate is_finite (x:t) = class x = Finite predicate is_infinite (x:t) = class x = Infinite predicate is_NaN (x:t) = class x = NaN predicate is_not_NaN (x:t) = is_finite x \/ is_infinite x predicate is_minus_infinity (x:t) = is_infinite x /\ sign x = Neg predicate is_plus_infinity (x:t) = is_infinite x /\ sign x = Pos predicate is_gen_zero (x:t) = is_finite x /\ value x = 0.0 predicate is_gen_zero_plus (x:t) = is_gen_zero x /\ sign x = Pos predicate is_gen_zero_minus (x:t) = is_gen_zero x /\ sign x = Neg predicate le (x:t) (y:t) = (is_finite x /\ is_finite y /\ value x <= value y) \/ (is_minus_infinity x /\ is_not_NaN y) \/ (is_not_NaN x /\ is_plus_infinity y) end theory Single type single ... ... @@ -124,15 +135,4 @@ theory Double end theory Test use import Rounding use Single use Double lemma Round_single_01: Single.round NearestTiesToEven 0.1 = 0x1.99999ap-4 lemma Round_double_01: Double.round NearestTiesToEven 0.1 = 0x1.999999999999ap-4 end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!