Crates.io | puruspe |
lib.rs | puruspe |
version | 0.3.0 |
source | src |
created_at | 2020-02-28 08:10:04.345413 |
updated_at | 2024-10-17 07:31:03.912211 |
description | Pure Rust Special function library |
homepage | |
repository | https://github.com/Axect/puruspe |
max_upload_size | |
id | 213463 |
size | 171,370 |
PURe RUSt SPEcial function library.
Add this to your Cargo.toml
:
[dependencies]
puruspe = "0.3.0"
use puruspe::gamma;
fn main() {
let x = 5.0;
let result = gamma(x);
println!("Gamma({}) = {}", x, result);
}
gamma(x)
: Gamma functionln_gamma(x)
: Natural logarithm of the gamma functiongammp(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 functionbeta(z, w)
: Beta functionbetai(a, b, x)
: Regularized incomplete beta function I_x(a,b)invbetai(p, a, b)
: Inverse of the regularized incomplete beta functionerf(x)
: Error functionerfc(x)
: Complementary error functioninverf(p)
: Inverse error functioninverfc(p)
: Inverse complementary error functionJn(n, x)
: Bessel function of the first kind of integer orderYn(n, x)
: Bessel function of the second kind of integer orderIn(n, x)
: Modified Bessel function of the first kind of integer orderKn(n, x)
: Modified Bessel function of the second kind of integer orderJnu_Ynu(nu, x)
: Bessel functions of the first and second kind of fractional orderInu_Knu(nu, x)
: Modified Bessel functions of the first and second kind of fractional orderbesseljy(nu, x)
: Bessel functions of the first and second kind with derivativesbesselik(nu, x)
: Modified Bessel functions of the first and second kind with derivativeslambert_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 f64
s.sp_lambert_wm1(x)
: The secondary branch of the Lambert W function computed to 24 bits of accuracy on f64
s.dawson(x)
: Dawson's integralThe 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.
tests/gamma_test.rs
tests/beta_test.rs
tests/bessel_test.rs
tests/erf_test.rs
tests/lambert_w_test.rs
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.
Contributions are welcome! Here are some ways you can contribute to this project:
When contributing code, please ensure that:
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.
This project is dual-licensed under either of
at your option.