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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aitkens-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 47afacabb07e94f7324b8cfe03d0e8e57a3fc6d6a2a7c2194f9dab7bda9f1720
MD5 a731db53374ae12dd4603427b699af30
BLAKE2b-256 6215326f3e9ba97a4b34f8d3f8c0e85001c11f8989be6982a0b776121c97e56a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aitkens-0.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed6a82dca5336bda6760d818d18bb5e8de61fdcdccee87187654bc6c198afd9f
MD5 d383c8d380318ad01d61af54b000472c
BLAKE2b-256 c29a870ab698a3ff7dbac982787981736d3f79f12833dd7c9aa8f690ecb130e7

See more details on using hashes here.

Supported by

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