#gamma #beta #special #erf

puruspe

Pure Rust Special function library

11 releases

0.2.5 Aug 3, 2024
0.2.4 Apr 4, 2024
0.2.3 Feb 18, 2024
0.2.0 May 2, 2022
0.1.3 Feb 29, 2020

#20 in Science

Download history 7628/week @ 2024-05-17 8736/week @ 2024-05-24 14496/week @ 2024-05-31 16250/week @ 2024-06-07 8793/week @ 2024-06-14 11952/week @ 2024-06-21 12633/week @ 2024-06-28 13548/week @ 2024-07-05 10214/week @ 2024-07-12 9556/week @ 2024-07-19 9898/week @ 2024-07-26 12412/week @ 2024-08-02 12199/week @ 2024-08-09 16186/week @ 2024-08-16 18073/week @ 2024-08-23 9786/week @ 2024-08-30

58,339 downloads per month
Used in 21 crates (3 directly)

MIT/Apache

54KB
1.5K SLoC

PURUSPE

On crates.io On docs.rs

PURe RUSt SPEcial function library. There are no dependencies.

Implemented Functions

Gamma functions

  • ln_gamma : Logarithmic gamma function
  • gamma : Gamma function
  • gammp : Regularized lower gamma function
  • gammq : Regularized upper gamma function
  • invgammp : Inverse regularized lower gamma function

Beta function

  • beta : Beta function
  • betai : Regularized Incomplete beta function
  • invbetai : Inverse regularized incomplete beta function

Error functions

  • erf : Error function
  • erfc : Complementary Error function
  • inverf : Inverse error function
  • inverfc : Inverse complementary error function

Bessel functions

  • Jn : Bessel function of the first kind (integer order)
  • Yn : Bessel function of the second kind (integer order)
  • In : Modified Bessel function of the first kind (integer order)
  • Kn : Modified Bessel function of the second kind (integer order)
  • Jnu_Ynu : Bessel function of the first kind and second kind (fractional order)
  • Inu_Knu : Modified Bessel function of the first kind and second kind (fractional order)
  • besseljy : Bessel function of the first and second kinds (include derivatives)
  • besselik : Modified Bessel function of the second kind (include derivatives)

Dawson's integral

  • dawson: Dawson's integral

Note on precision of Bessel functions

Bessel functions exhibit poor precision for extremely large arguments. For instance, Jn(1,1e10) yields only 6 correct digits, in contrast to the typical 14 digits of double precision. This behavior is comparable to Python's scipy.special.j1, which is an optimized variant of the Bessel J function.

Reference

  • Press, William H., and William T. Vetterling. Numerical Recipes. Cambridge: Cambridge Univ. Press, 2007.

No runtime deps