Skip to main content

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, fm_scaled

# Compute FM(x) * exp(x) - the numerically stable form
result = syncF(1.0)

# Compute FM(x) = exp(-x) * integral of t^(-1/2) * exp(-t) / (1 + t/x) dt
result_scaled = fm_scaled(1.0)

# Works with numpy arrays
import numpy as np
x = np.linspace(0.001, 100, 1000)
y = syncF(x)

Performance

The C extension uses METH_O calling convention with PyFloat_AS_DOUBLE for minimal overhead:

x range syncF(x) time Notes
Small (1e-8) ~38 ns Cube-root expansion
Wide (1.0) ~45 ns Rational approximation
Large (1e10) ~32 ns Asymptotic expansion

Comparable to math.sin (~38 ns) - only ~20 ns above the minimum possible CPython C-extension overhead (~16 ns for extract+create).

Array throughput: ~10 ns/element.

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

Metadata

Release files for accurpy 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for accurpy 0.2.3
File Size Uploaded Provenance
accurpy-0.2.3.tar.gz 21.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for accurpy 0.2.3
File Interpreter ABI Platform
accurpy-0.2.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details

Total release size: 57.9 kB

Release files / accurpy-0.2.3.tar.gz

Download URL accurpy-0.2.3.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
54dfa0512c2fcc731a4ff7a9d10d8cdea3f6dd4b96ec59e4a0866006bb98162c
BLAKE2b-256 checksum
How to use checksums
21796ea0dc4251a14eec7cd4782f222910e0c9a320db067bd48294670774b645
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / accurpy-0.2.3-cp313-cp313-win_amd64.whl

Download URL accurpy-0.2.3-cp313-cp313-win_amd64.whl
Size 36.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
2d649c8b058a6ec99010ce7ba371b76ca083ecbec3ffc0245d0e69d2fc718067
BLAKE2b-256 checksum
How to use checksums
7c7aad1e21f708c38efb424cdc5f12b9e66dac62c0c92a7ad4316403a5f671aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for accurpy 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page