Example
> f:=x->exp(x)-x-1;
> p[0]:=1.0;
> for i from 1 to 10 do p[i]:=p[i-1]-f(p[i-1])/(D(f)(p[i-1])): print(i,p[i]); od:
When we apply Aitken's Method:
> for i from 0 to 8 do pp[i]:=p[i]-(p[i+1]-p[i])^2/(p[i+2]-2*p[i+1]+p[i]): if i>=1 then print(i,pp[i],abs(pp[i]/pp[i-1])); fi; od:
which converges more rapidly to the real root
, but still behaves linearly. Repeating this method yields
> for i from 0 to 6 do ppp[i]:=pp[i]-(pp[i+1]-pp[i])^2/(pp[i+2]-2*pp[i+1]+pp[i]): if i>= 1 then print(i,ppp[i],abs(ppp[i]/ppp[i-1])); fi; od:
which, allthough still linear, becomes far more accurate.
The above example shows that, where iteration itself is cumbersome, more accurate estimates may be found using Aitken's Method.