Catalog PyPI
Back to packageRELEASE DETAILS

0.2.3

PyPI

accurpy

Ultra-accurate and fast FM function evaluator with <4.5e-16 relative error

accuracyfmfunctionfunctionsnumericsspecial
Published1 Dec 2025
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.2.3 documentation

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 rangesyncF(x) timeNotes
Small (1e-8)~38 nsCube-root expansion
Wide (1.0)~45 nsRational approximation
Large (1e10)~32 nsAsymptotic 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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
numpy>=1.20runtime

Distribution files

2 collected
accurpy-0.2.3-cp313-cp313-win_amd64.whl

bdist_wheel · 35.65 KB · Python cp313

Source file
accurpy-0.2.3.tar.gz

sdist · 20.89 KB · Python source

Source file

Repository

PENDING
accurpy/accurpy

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:03 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:aad98f97a697550a6721b2454bc513df690456fe6bbec58c20fbf06ceec4096f

Other collected versions

View all collected versions →