Ultra-accurate and fast FM function evaluator with <4.5e-16 relative error
Project description
AccurPy
Ultra-accurate and fast FM function evaluator with <4.5e-16 relative error (~2x machine epsilon).
Installation
pip install accurpy
Usage
from accurpy import syncF
# Compute FM(x) = exp(-x) * integral of t^(-1/2) * exp(-t) / (1 + t/x) dt
result = syncF(1.0)
# Skip the exp(-x) factor (returns FM(x) * exp(x))
result_scaled = syncF(1.0, skip_exp=True)
# Works with numpy arrays
import numpy as np
x = np.linspace(0.001, 100, 1000)
y = syncF(x)
Performance
- C extension: ~10-20 nanoseconds per evaluation
- Pure Python fallback available when C extension cannot be built
Accuracy
- Relative error < 4.5e-16 across entire domain (x > 0)
- Three-region algorithm:
- Small x (< 1e-7): Cube-root expansion
- Wide domain (1e-7 to 1e6): 63-segment rational approximation
- Large x (> 1e6): Asymptotic expansion
License
MIT
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
accurpy-0.2.0.tar.gz
(21.7 kB
view details)
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 accurpy-0.2.0.tar.gz.
File metadata
- Download URL: accurpy-0.2.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b71c2b24b0126c1594b68d0782dfb51ed64b55ee1ee17d04f7e6abc2032cb7d
|
|
| MD5 |
65cad0cd1acbfdb6ccebf2f5f90ce1b5
|
|
| BLAKE2b-256 |
a456b4d0bce0b60ec28a5b1ee6dd01d6cc682ad1f45fa2c6bf7f8079193acc69
|
File details
Details for the file accurpy-0.2.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: accurpy-0.2.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 36.1 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaec45e4f96c741f9457c6196fd4d87bb8051abf4c45e40551ccd717172aa085
|
|
| MD5 |
ab95e44f467ba7ad12043f24cc8e1c84
|
|
| BLAKE2b-256 |
5625b36afddd790b433a48cd825e65eeea2ccf18f4f7b102989f5fa26bee3200
|