main()
{
double B=4095.1;
double A=B+1;
/* A-B = 1 à epsilon près !!! */
double x=1;
int n;
printf("initialisation x=%+.16f\n",x);
for (n=1 ; n<=9 ; n++)
{
x = (A*x) - B;
/* La première fois : */
/* */
/* (A*x)-B --> (A*1)-B --> A-B --> 1 */
/* */
/* donc 'x' est un invariant (x = 1)... */
printf("iteration %01d x = %+.16f\n",n,x);
}
}
initialisation x = +1.0000000000000000
iteration 1 x = +1.0000000000004547
iteration 2 x = +1.0000000018630999
iteration 3 x = +1.0000076314440776
iteration 4 x = +1.0312591580864137
iteration 5 x = +129.0406374377594148
iteration 6 x = +524468.2550088063580915
iteration 7 x = +2148270324.2415719032287598
iteration 8 x = +8799530071030.8046875000000000
iteration 9 x = +36043755123945184.0000000000000000
JFC
www.lactamme.polytechnique.fr