Skip to main content

High-precision error functions and normal distribution (Cody's algorithm)

Project description

cody-special

High-precision error functions and normal distribution implementations based on W.J. Cody's rational Chebyshev approximations.

Installation

pip install cody-special

Usage

from cody_special import erf_cody, erfc_cody, erfcx_cody
from cody_special import norm_pdf, norm_cdf, inverse_norm_cdf

# Error functions
erf_cody(1.0)      # ~ 0.8427
erfc_cody(1.0)     # ~ 0.1573
erfcx_cody(1.0)    # ~ 0.4276

# Normal distribution
norm_pdf(0.0)           # ~ 0.3989 (standard normal PDF)
norm_cdf(0.0)           # = 0.5 (standard normal CDF)
inverse_norm_cdf(0.5)   # = 0.0 (inverse CDF / quantile function)

References

  • W.J. Cody, "Rational Chebyshev approximations for the error function", Math. Comp., 1969, pp. 631-638.
  • Peter Jaeckel, "Let's Be Rational", www.jaeckel.org

License

MIT License. Original algorithm by W.J. Cody. Python implementation derived from Peter Jaeckel's LetsBeRational.

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

cody_special-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

cody_special-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file cody_special-1.0.0.tar.gz.

File metadata

  • Download URL: cody_special-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.2 Darwin/24.6.0

File hashes

Hashes for cody_special-1.0.0.tar.gz
Algorithm Hash digest
SHA256 795f9268155b845310855f76d9a0d63dabb6fe5f1c3d3fc10814b38eefa5d537
MD5 4ef274a698e9db53596931c7e8b949e8
BLAKE2b-256 ced298a4c5409f66d021c590102c5839434dd1880d36a248a2d61342976cfaff

See more details on using hashes here.

File details

Details for the file cody_special-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cody_special-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.2 Darwin/24.6.0

File hashes

Hashes for cody_special-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a871562b9cdfb7826ec514c90d8dec175704e58ccffa0341f45194e6d4fc6102
MD5 d8c55cd635efa65377c4415a5112cbdf
BLAKE2b-256 11892d787764e8fdc1302d2989a4bef5812e1af8bc6773f58d1a742fe8cfe5a5

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