1 /*@ lemma method_error: \forall real x;
2 @ \abs(x) <= 0x1p-5 ==> \abs(1.0 - x*x*0.5 - \cos(x)) <= 0x1p-24;
5 /*@ requires \abs(x) <= 0x1p-5;
6 @ ensures \abs(\result - \cos(x)) <= 0x1p-23;
8 float my_cos1(float x
) {
9 //@ assert \abs(1.0 - x*x*0.5 - \cos(x)) <= 0x1p-24;
10 return 1.0f
- x
* x
* 0.5f
;