
theory TestGappa

   use real.Real
   use real.Abs
   use real.Square
   use floating_point.Rounding
   use floating_point.Single as Single
   use 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



