use crate::ffi;
pub fn beta(a: f64, b: f64) -> f64 {
unsafe { ffi::math_beta(a, b) }
}
pub fn beta_(a: f64, b: f64, x: f64) -> f64 {
unsafe { ffi::math_beta_(a, b, x) }
}
pub fn betac(a: f64, b: f64, x: f64) -> f64 {
unsafe { ffi::math_betac(a, b, x) }
}
pub fn ibeta(a: f64, b: f64, x: f64) -> f64 {
unsafe { ffi::math_ibeta(a, b, x) }
}
pub fn ibeta_derivative(a: f64, b: f64, x: f64) -> f64 {
unsafe { ffi::math_ibeta_derivative(a, b, x) }
}
pub fn ibeta_inv(a: f64, b: f64, p: f64) -> f64 {
unsafe { ffi::math_ibeta_inv(a, b, p) }
}
pub fn ibeta_inva(b: f64, x: f64, p: f64) -> f64 {
unsafe { ffi::math_ibeta_inva(b, x, p) }
}
pub fn ibeta_invb(a: f64, x: f64, p: f64) -> f64 {
unsafe { ffi::math_ibeta_invb(a, x, p) }
}
pub fn ibetac(a: f64, b: f64, x: f64) -> f64 {
unsafe { ffi::math_ibetac(a, b, x) }
}
pub fn ibetac_inv(a: f64, b: f64, q: f64) -> f64 {
unsafe { ffi::math_ibetac_inv(a, b, q) }
}
pub fn ibetac_inva(b: f64, x: f64, q: f64) -> f64 {
unsafe { ffi::math_ibetac_inva(b, x, q) }
}
pub fn ibetac_invb(a: f64, x: f64, q: f64) -> f64 {
unsafe { ffi::math_ibetac_invb(a, x, q) }
}
#[cfg(test)]
mod smoketests {
use super::*;
#[test]
fn test_beta() {
let result = beta(0.5, 0.5);
assert_relative_eq!(result, core::f64::consts::PI, epsilon = f64::EPSILON);
}
#[test]
fn test_beta_() {
let result = beta_(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_betac() {
let result = betac(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibeta() {
let result = ibeta(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibeta_derivative() {
let result = ibeta_derivative(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibeta_inv() {
let result = ibeta_inv(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibeta_inva() {
let result = ibeta_inva(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibeta_invb() {
let result = ibeta_invb(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibetac() {
let result = ibetac(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibetac_inv() {
let result = ibetac_inv(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibetac_inva() {
let result = ibetac_inva(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
#[test]
fn test_ibetac_invb() {
let result = ibetac_invb(0.5, 0.5, 0.5);
assert!(result.is_finite());
}
}