Skip to main content

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


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

Uploaded Source

Built Distribution

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

accurpy-0.2.1-cp313-cp313-win_amd64.whl (36.0 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file accurpy-0.2.1.tar.gz.

File metadata

  • Download URL: accurpy-0.2.1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for accurpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fe2a70648cc1218ca6817e5d0783545146395cc86b3a1ddcad14ed7c31f63a58
MD5 e19b99b21dd1dbd24c9f6b34b6b80e93
BLAKE2b-256 9d8c806635a10b7361f857dcff6154a96b6849d0c93ddc935bbbde5dcda9dde8

See more details on using hashes here.

File details

Details for the file accurpy-0.2.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: accurpy-0.2.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 36.0 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

Hashes for accurpy-0.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 22744a704efef3000add9314f531d134cf93d6ab3462b1ccb000b82e88cefa66
MD5 e2da8cd4f232e2e077ea4832b5e6a3b6
BLAKE2b-256 193e4076ec828b9316143f684f9c09742d2d462d5d39909685369ea722b789cf

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