abax 0.1.8

A lightweight Rust library providing high-precision mathematical constants and special functions, including Bernoulli numbers, Riemann Zeta values, and robust incomplete gamma functions.
Documentation

abax

A lightweight Rust library providing high-precision mathematical constants and special functions.

Features

  • Mathematical Constants:
    • Bernoulli numbers (B2n) up to n=16.
    • Riemann Zeta function values for integers 2 through 16.
    • Euler-Mascheroni constant.
    • Stirling series coefficients for asymptotic expansions.
  • Special Functions:
    • gamma(x): Gamma function Γ(x) computed with the Lanczos approximation and reflection formula.
    • gammaln(x): Natural logarithm of the Gamma function ln(Γ(x)) using Stirling's approximation for high precision.
    • digamma(x): Digamma function ψ(x), the logarithmic derivative of Γ(x), implemented with reflection, recurrence shifting, and asymptotic expansion for numerical stability.
    • trigamma(x): Trigamma function ψ(1)(x), implemented with reflection, recurrence shifting, and asymptotic expansion for numerical stability.
    • tetragamma(x): Tetragamma function ψ(2)(x), implemented with reflection, recurrence shifting, and asymptotic expansion for numerical stability.
    • gammainc(x, a, lower, scaled): Regularized lower/upper incomplete gamma function with explicit lower/upper tail selection; when scaled=true, returns tail value multiplied by Γ(a+1)exx-a for improved conditioning at large x.
    • gammaincinv(y, a, lower): Numerically robust inverse of the regularized incomplete gamma function utilizing a combined Halley-Newton-Bisection method for enhanced convergence speed and stability in tail regions.
    • psi(k, x): Polygamma interface returning ψ(k)(x) with stable handling of poles and infinities.

Usage

Add this to your Cargo.toml:

[dependencies]
abax = "0.1.8"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Repository

Source code is available on GitHub.