Skip to main content

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

  1. https://en.wikipedia.org/wiki/Aitken%27s_delta-squared_process

Licence

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Project details


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)

Uploaded Source

Built Distribution

aitkens-0.1.0-py3-none-any.whl (2.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page