Approximations of the cosine function

The following program provides various approximations of the cosine
function on small intervals around 0.

Using Frama-C/Jessie
with the strict-IEEE float model, we specify
bounds on the total error expected from each function. An assertion in
the code is inserted in each function, to express the mathematical
error, that is without taking rounding in account.

The third function assumes that the argument is given with an
already non-null rounding error, and the error on the result is given
in terms of this rounding error on input.

This is proved by a combination of automated provers (SMT solvers and
Gappa) and the
Coq proof assistant.

The following screenshot shows that SMT solvers and Gappa verify all
verification conditions except the mathematical method errors. The latter
are verified inside Coq using the interval tactic, shown
on the second screenshot below.