Aitken's delta-squared acceleration
Project description
aitkens
Aitken's delta-squared series acceleration method
J. M. F. Tsang (j.m.f.tsang@cantab.net)
Usage
Given an object xs
that can be turned into a one-dimensional numpy
array, run:
from aitkens import accelerate
accelerate(xs)
Example: Iterates of $\sqrt{2}$
This example, which is given on the Wikipedia article [1], is actually a poor example since the original iterates converge quadratically, rather than linearly. The accelerated sequence's terms tend to overshoot the true values.
from itertools import accumulate
from aitkens import accelerate
iterates = list(accumulate(
range(5), lambda x, _: 0.5 * (x + 2/x), initial=1
))
acc = accelerate(iterates)
References
Licence
This work is licensed under a Creative Commons Attribution 4.0 International License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aitkens-0.1.0.tar.gz
(1.9 kB
view hashes)