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.0.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

aitkens-0.0.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file aitkens-0.0.0.tar.gz.

File metadata

  • Download URL: aitkens-0.0.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for aitkens-0.0.0.tar.gz
Algorithm Hash digest
SHA256 10e27fb24e089d2f44c420de9ed72933f1ae512366fbba7c945476feb304c093
MD5 91744c720e5ccda5bf5bd529c2138183
BLAKE2b-256 2c79d408f441b00dfb481e95c8ebad432f1b3b3850e84bfd3a63acbaa7d9b9a6

See more details on using hashes here.

File details

Details for the file aitkens-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: aitkens-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for aitkens-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ec1554327f1205eb83d37b0ebc03b62b4d379c7654c6da1dad1fb29f0a064a8
MD5 a9af47952b02e505bace5995ded2c854
BLAKE2b-256 6383704e6afa15ef941c12ec8031675059ced5c8ff1d2dfb6ed5429e1886b9b9

See more details on using hashes here.

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