Mioara.Joldes@laas.fr
Florian.Steinberg@inria.fr
Laurent.Thery@inria.fr
Check 1 + 2. 1 + 2 : nat Compute 1 + 2. 3 : nat Check addnC. addnC : forall x y : nat, x + y = y + x Check (addnC 1 2). addnC 1 2 : 1 + 2 = 2 + 1
Check exp (1 + 2). exp (1 + 2) : R Check exprD. exprD : forall x y : nat, exp (x + y) = exp x * exp y Compute exp (1 + 2). ???
Float \begin{array}{rcl} \\ \{ \texttt{num} : \mathbb{Z} ;\, \texttt{exp} : \mathbb{Z} \} & : & \textit{float} \\ \\ [ \{ \texttt{num} = n ;\, \texttt{exp} = e \} ]_f & = & n \times_r 2 ^ e : \mathbb{R} \\ \\ \forall\, f_1 f_2,\,\, [ f_1 +_f f_2 ]_f & = & [ f_1 ]_f +_r [ f_2 ]_f \\ \\ \end{array}
Interval \begin{array}{rcl} \\ \{ \texttt{l} : \textit{float} ;\, \texttt{r} : \textit{float} \} & : & \textit{interval} \\ \bot & : & \textit{interval} \\ \\ r \in \{ \texttt{l} = f_1 ;\, \texttt{r} = f_2 \} & \iff & [f_1]_f \le_r r \le_r [f_2]_f \\ r \in \bot & \iff & \textit{True} \\\\ \forall\, r\, i,\,\, r \in i & \Rightarrow & exp_r\, r \in exp_i\, i\\ \end{array}
Taylor Models
\begin{align*}
e^x - 1 \approx x + 8388676 / 2^{24} x^2 + 11184876/2^{26} x^3
\end{align*}
Lemma tang : forall x : R, -10831/1000000 <= x <= 10831/1000000 -> Rabs (exp x - 1 - (x + 8388676 / 2^24 * x^2 + 11184876/2^26 * x^3)) <= (23/27) / 2^33. Proof. intros x H. interval with (i_bisect_taylor x 3, i_depth 8, i_prec 52). Qed.
Definition
Properties
Definition
Properties
Definition
Properties
Definition
Properties
Lemma ierror_val :
forall (f : R -> R) (n : nat) (l : seq R),
n = size l ->
uniq l ->
forall a b c1 c2 : R,
c1 < a ->
b < c2 ->
(forall x : R, x \in l -> a <= x <= b) ->
(forall (x : R) (k : nat),
c1 < x < c2 -> k <= n -> ex_derive_n f k x) ->
(forall (x : R) (k : nat),
k <= n -> a <= x <= b -> continuous (Derive_n f k) x) ->
forall x : R,
a <= x <= b ->
ierror f l x != 0 ->
exists z : R,
a <= z <= b /\
ierror f l x = 1 / n`! * Derive_n f n z * (prodl l).[x]
Definition
Properties
Lemma ierror_cheby :
forall (f : R -> R) (c1 c2 : R),
c1 < -1 ->
1 < c2 ->
forall n : nat,
(forall (x : R) (k : nat),
c1 < x < c2 -> k <= n -> ex_derive_n f k x) ->
(forall (x : R) (k : nat),
k <= n -> -1 <= x <= 1 -> continuous (Derive_n f k) x) ->
forall x z : R,
-1 <= x <= 1 ->
(forall y : R, -1 <= y <= 1 -> Rabs (Derive_n f n y) <= z) ->
Rabs (ierror f (cheby_nodes n) x) <= 1 / (2 ^ n.-1 * n`!) * z
Lemma interpolation_cheby_ge :
forall (n : nat) (c1 c2 : R) (f : R -> R) (x : R),
c1 < -1 ->
1 < c2 ->
-1 <= x <= 1 ->
(forall (m : nat) (x0 : R),
(m <= n.+1)%N -> -1 <= x0 <= 1 ->
continuous (Derive_n f m) x0) ->
(forall x0 : R, -1 <= x0 <= 1 -> Derive_n f n.+1 x0 <= 0) \/
(forall x0 : R, -1 <= x0 <= 1 -> Derive_n f n.+1 x0 >= 0) ->
(forall (m : nat) (x0 : R),
(m <= n.+1)%N -> c1 < x0 < c2 -> ex_derive_n f m x0) ->
Rabs (ierror f (cheby_nodes n) x) <=
Rmax (Rabs (ierror f (cheby_nodes n) (-1)))
(Rabs (ierror f (cheby_nodes n) 1))
Definition tang := exp(x) - 1 - (x + c(8388676, 2^24) * x * x + c(11184876, 2^26) * x * x * x). Lemma tang_correct : forall x, (-10831 / 1000000 <= x <= 10831 / 1000000) -> (-23 / (27 * 2^33)) <= (exp x - 1 - (x + 8388676/ 2^24 * x * x + 11184876 / 2^26 * x * x * x)) <= 23 / (27 * 2^33). Proof. move=> x H. cheby_solve_tac 52 7 3 tang H. Qed.
40 pages (x 40 lines) = 8600 lines of Coq