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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47afacabb07e94f7324b8cfe03d0e8e57a3fc6d6a2a7c2194f9dab7bda9f1720
|
|
| MD5 |
a731db53374ae12dd4603427b699af30
|
|
| BLAKE2b-256 |
6215326f3e9ba97a4b34f8d3f8c0e85001c11f8989be6982a0b776121c97e56a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed6a82dca5336bda6760d818d18bb5e8de61fdcdccee87187654bc6c198afd9f
|
|
| MD5 |
d383c8d380318ad01d61af54b000472c
|
|
| BLAKE2b-256 |
c29a870ab698a3ff7dbac982787981736d3f79f12833dd7c9aa8f690ecb130e7
|