Crates.io | spfunc |
lib.rs | spfunc |
version | 0.1.0 |
source | src |
created_at | 2021-04-10 08:53:15.147756 |
updated_at | 2021-04-10 08:53:15.147756 |
description | Rust crate for numerical calculation of special functions. |
homepage | |
repository | https://github.com/doraneko94/spfunc |
max_upload_size | |
id | 381643 |
size | 24,287 |
Rust crate for numerical calculation of special functions.
This crate can calculate each special function for f32, f64, Complex32, Complex64 (from num_complex crate).
This crate is still in the development stage and the numerical calculations are not so accurate (especially Hurwitz zeta function).
use spfunc::gamma::*;
use cauchy::{c32, c64};
fn main() {
println!("Gamma(1.0) = {}", gamma(1.0));
println!("ln(Gamma(1.0)) = {}", gamma_ln(1.0));
println!("Gamma(1.2+3.4i) = {}", gamma(c32::new(1.2, 3.4)));
println!("ln(Gamma(1.2+3.4i)) = {}", gamma_ln(c32::new(1.2, 3.4)));
println!("DiGamma(1.2+3.4i) = {}", digamma(c64::new(1.2, 3.4)));
println!("TriGamma(1.2+3.4i) = {}", polygamma(c64::new(1.2, 3.4), 1))
}