https://github.com/axect/puruspe

PURe RUSt SPEcial function library

https://github.com/axect/puruspe

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary

Keywords

numerical rust special-functions
Last synced: 6 months ago · JSON representation

Repository

PURe RUSt SPEcial function library

Basic Info
  • Host: GitHub
  • Owner: Axect
  • License: apache-2.0
  • Language: Rust
  • Default Branch: master
  • Homepage:
  • Size: 1.35 MB
Statistics
  • Stars: 22
  • Watchers: 4
  • Forks: 8
  • Open Issues: 5
  • Releases: 1
Topics
numerical rust special-functions
Created almost 6 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

PURUSPE

On crates.io On docs.rs

PURe RUSt SPEcial function library.

Features

  • Gamma functions
  • Beta functions
  • Error functions
  • Bessel functions
  • Lambert W functions
  • Dawson function

Usage

Add this to your Cargo.toml:

toml [dependencies] puruspe = "0.4.1"

Example

```rust use puruspe::gamma;

fn main() { let x = 5.0; let result = gamma(x); println!("Gamma({}) = {}", x, result); } ```

Available Functions

Gamma Functions

  • gamma(x): Gamma function
  • ln_gamma(x): Natural logarithm of the gamma function
  • gammp(a, x): Regularized lower incomplete gamma function P(a,x)
  • gammq(a, x): Regularized upper incomplete gamma function Q(a,x)
  • invgammp(p, a): Inverse of the regularized lower incomplete gamma function

Beta Functions

  • beta(z, w): Beta function
  • betai(a, b, x): Regularized incomplete beta function I_x(a,b)
  • invbetai(p, a, b): Inverse of the regularized incomplete beta function

Error Functions

  • erf(x): Error function
  • erfc(x): Complementary error function
  • erfcx(x): Scaled complementary error function
  • inverf(p): Inverse error function
  • inverfc(p): Inverse complementary error function

Faddeeva Function

  • faddeeva(x): Faddeeva function

Bessel Functions

  • Jn(n, x): Bessel function of the first kind of integer order
  • Yn(n, x): Bessel function of the second kind of integer order
  • In(n, x): Modified Bessel function of the first kind of integer order
  • Kn(n, x): Modified Bessel function of the second kind of integer order
  • Jnu_Ynu(nu, x): Bessel functions of the first and second kind of fractional order
  • Inu_Knu(nu, x): Modified Bessel functions of the first and second kind of fractional order
  • besseljy(nu, x): Bessel functions of the first and second kind with derivatives
  • besselik(nu, x): Modified Bessel functions of the first and second kind with derivatives

Lambert W Functions

  • lambert_w(k, z_re, z_im): Branch k of the complex valued Lambert W function computed at point z in the complex plane.
  • lambert_w0(x): The principal branch of the Lambert W function computed to 50 bits of accuracy.
  • lambert_wm1(x): The secondary branch of the Lambert W function computed to 50 bits of accuracy.
  • sp_lambert_w0(x): The principal branch of the Lambert W function computed to 24 bits of accuracy on f64s.
  • sp_lambert_wm1(x): The secondary branch of the Lambert W function computed to 24 bits of accuracy on f64s.

Dawson Function

  • dawson(x): Dawson's integral

Precision

The precision of each function can vary depending on the input values and the complexity of the calculation. For detailed information about the precision of specific functions, please refer to the test files in the tests/ directory.

  • Gamma function precision: see tests/gamma_test.rs
  • Beta function precision: see tests/beta_test.rs
  • Bessel function precision: see tests/bessel_test.rs
  • Error function precision: see tests/erf_test.rs
  • Faddeeva function precision: see tests/faddeeva_test.rs
  • Lambert W function precision: see tests/lambert_w_test.rs
  • Dawson function precision: see tests/dawson_test.rs

These test files contain comparisons between the results of our implementations and the corresponding functions in SciPy, a widely-used scientific computing library in Python. This comparison provides insights into the precision of each function across various input ranges.

The test tables used for these comparisons are generated using SciPy, and the scripts for generating these tables can be found in the scripts/ directory. This allows for transparent verification and updating of our test cases.

Note that while we strive for high accuracy, the actual precision in your use case may differ slightly from the test cases. If you require guaranteed precision for a specific input range, we recommend additional testing for your particular use case.

Also, please be aware that there might be small discrepancies between our implementation and SciPy's results due to differences in algorithms or internal precision. These discrepancies are generally within acceptable margins for most applications, but if you need exact agreement with SciPy or any other specific implementation, you should perform detailed comparisons.

Contributing

Contributions are welcome! Here are some ways you can contribute to this project:

  1. Report bugs and request features by opening issues.
  2. Submit pull requests to fix bugs or add new features.
  3. Improve documentation or add examples.
  4. Add new special functions or optimize existing ones.

When contributing code, please ensure that:

  1. Your code follows the existing style of the project.
  2. You add appropriate tests for your changes.
  3. All tests pass when you run cargo test.

If you're adding new functions or making significant changes, you may need to update or create new test tables. You can use the Python scripts in the scripts/ directory to generate these tables using SciPy.

License

This project is dual-licensed under either of

at your option.

Reference

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

Owner

  • Name: Tae-Geun Kim
  • Login: Axect
  • Kind: user
  • Location: Seoul, South Korea
  • Company: Yonsei Univ.

Ph.D student of particle physics & Rustacean

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 11
  • Watch event: 7
  • Issue comment event: 44
  • Push event: 18
  • Pull request review comment event: 9
  • Pull request review event: 17
  • Pull request event: 26
  • Fork event: 2
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 11
  • Watch event: 7
  • Issue comment event: 44
  • Push event: 18
  • Pull request review comment event: 9
  • Pull request review event: 17
  • Pull request event: 26
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 205
  • Total Committers: 6
  • Avg Commits per committer: 34.167
  • Development Distribution Score (DDS): 0.473
Past Year
  • Commits: 179
  • Committers: 5
  • Avg Commits per committer: 35.8
  • Development Distribution Score (DDS): 0.397
Top Committers
Name Email Commits
Johanna Sörngård j****d@g****m 108
axect a****g@p****e 76
Ethan Barry e****y@h****t 17
Jeong YunWon j****g@y****g 2
Robert Winslow rw 1
Konstantin Ladutenko k****k@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 10
  • Total pull requests: 43
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 7 days
  • Total issue authors: 9
  • Total pull request authors: 6
  • Average comments per issue: 4.1
  • Average comments per pull request: 2.05
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 29
  • Average time to close issues: 21 days
  • Average time to close pull requests: 11 days
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 1.17
  • Average comments per pull request: 2.03
  • Merged pull requests: 25
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JSorngard (2)
  • ethanbarry (1)
  • bojohnson5 (1)
  • Axect (1)
  • dcnorris (1)
  • aoanla (1)
  • elgar328 (1)
  • kostyfisik (1)
  • arihant2math (1)
  • main-- (1)
Pull Request Authors
  • JSorngard (41)
  • ethanbarry (11)
  • Axect (5)
  • youknowone (4)
  • kostyfisik (2)
  • rw (1)
Top Labels
Issue Labels
enhancement (3) bug (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cargo 794,388 total
  • Total docker downloads: 23,282,367
  • Total dependent packages: 3
  • Total dependent repositories: 42
  • Total versions: 14
  • Total maintainers: 1
crates.io: puruspe

Pure Rust Special function library

  • Versions: 14
  • Dependent Packages: 3
  • Dependent Repositories: 42
  • Downloads: 794,388 Total
  • Docker Downloads: 23,282,367
Rankings
Docker downloads count: 3.3%
Dependent repos count: 4.5%
Downloads: 5.3%
Dependent packages count: 12.2%
Average: 12.9%
Forks count: 23.1%
Stargazers count: 29.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

Cargo.toml cargo
  • peroxide 0.35 development