use crate::ffi_apis::common::BincodeBuffer;
use crate::ffi_apis::common::from_bincode_buffer;
use crate::ffi_apis::common::to_bincode_buffer;
use crate::symbolic::core::Expr;
use crate::symbolic::special_functions;
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_gamma(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::gamma(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_ln_gamma(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::ln_gamma(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_beta(
a_buf: BincodeBuffer,
b_buf: BincodeBuffer,
) -> BincodeBuffer {
let a: Option<Expr> = from_bincode_buffer(&a_buf);
let b: Option<Expr> = from_bincode_buffer(&b_buf);
match (a, b) {
| (Some(val_a), Some(val_b)) => to_bincode_buffer(&special_functions::beta(val_a, val_b)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_erf(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::erf(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_erfc(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::erfc(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_erfi(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::erfi(a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_zeta(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::zeta(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_digamma(arg_buf: BincodeBuffer) -> BincodeBuffer {
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
if let Some(a) = arg {
to_bincode_buffer(&special_functions::digamma(&a))
} else {
BincodeBuffer::empty()
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_polygamma(
n_buf: BincodeBuffer,
z_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let z: Option<Expr> = from_bincode_buffer(&z_buf);
match (n, z) {
| (Some(n), Some(z)) => to_bincode_buffer(&special_functions::polygamma(&n, &z)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_bessel_j(
order_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let order: Option<Expr> = from_bincode_buffer(&order_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (order, arg) {
| (Some(o), Some(a)) => to_bincode_buffer(&special_functions::bessel_j(&o, &a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_bessel_y(
order_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let order: Option<Expr> = from_bincode_buffer(&order_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (order, arg) {
| (Some(o), Some(a)) => to_bincode_buffer(&special_functions::bessel_y(&o, &a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_bessel_i(
order_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let order: Option<Expr> = from_bincode_buffer(&order_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (order, arg) {
| (Some(o), Some(a)) => to_bincode_buffer(&special_functions::bessel_i(&o, &a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_bessel_k(
order_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let order: Option<Expr> = from_bincode_buffer(&order_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (order, arg) {
| (Some(o), Some(a)) => to_bincode_buffer(&special_functions::bessel_k(&o, &a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_legendre_p(
degree_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let degree: Option<Expr> = from_bincode_buffer(°ree_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (degree, arg) {
| (Some(d), Some(a)) => to_bincode_buffer(&special_functions::legendre_p(&d, a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_laguerre_l(
degree_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let degree: Option<Expr> = from_bincode_buffer(°ree_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (degree, arg) {
| (Some(d), Some(a)) => to_bincode_buffer(&special_functions::laguerre_l(&d, a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_generalized_laguerre(
n_buf: BincodeBuffer,
alpha_buf: BincodeBuffer,
x_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let alpha: Option<Expr> = from_bincode_buffer(&alpha_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
match (n, alpha, x) {
| (Some(n), Some(alpha), Some(x)) => {
to_bincode_buffer(&special_functions::generalized_laguerre(&n, &alpha, &x))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_hermite_h(
degree_buf: BincodeBuffer,
arg_buf: BincodeBuffer,
) -> BincodeBuffer {
let degree: Option<Expr> = from_bincode_buffer(°ree_buf);
let arg: Option<Expr> = from_bincode_buffer(&arg_buf);
match (degree, arg) {
| (Some(d), Some(a)) => to_bincode_buffer(&special_functions::hermite_h(&d, a)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_chebyshev_t(
n_buf: BincodeBuffer,
x_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
match (n, x) {
| (Some(n), Some(x)) => to_bincode_buffer(&special_functions::chebyshev_t(&n, &x)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_chebyshev_u(
n_buf: BincodeBuffer,
x_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
match (n, x) {
| (Some(n), Some(x)) => to_bincode_buffer(&special_functions::chebyshev_u(&n, &x)),
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_bessel_differential_equation(
y_buf: BincodeBuffer,
x_buf: BincodeBuffer,
n_buf: BincodeBuffer,
) -> BincodeBuffer {
let y: Option<Expr> = from_bincode_buffer(&y_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
let n: Option<Expr> = from_bincode_buffer(&n_buf);
match (y, x, n) {
| (Some(y), Some(x), Some(n)) => {
to_bincode_buffer(&special_functions::bessel_differential_equation(&y, &x, &n))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_legendre_differential_equation(
y_buf: BincodeBuffer,
x_buf: BincodeBuffer,
n_buf: BincodeBuffer,
) -> BincodeBuffer {
let y: Option<Expr> = from_bincode_buffer(&y_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
let n: Option<Expr> = from_bincode_buffer(&n_buf);
match (y, x, n) {
| (Some(y), Some(x), Some(n)) => {
to_bincode_buffer(&special_functions::legendre_differential_equation(
&y, &x, &n,
))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_laguerre_differential_equation(
y_buf: BincodeBuffer,
x_buf: BincodeBuffer,
n_buf: BincodeBuffer,
) -> BincodeBuffer {
let y: Option<Expr> = from_bincode_buffer(&y_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
let n: Option<Expr> = from_bincode_buffer(&n_buf);
match (y, x, n) {
| (Some(y), Some(x), Some(n)) => {
to_bincode_buffer(&special_functions::laguerre_differential_equation(
&y, &x, &n,
))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_hermite_differential_equation(
y_buf: BincodeBuffer,
x_buf: BincodeBuffer,
n_buf: BincodeBuffer,
) -> BincodeBuffer {
let y: Option<Expr> = from_bincode_buffer(&y_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
let n: Option<Expr> = from_bincode_buffer(&n_buf);
match (y, x, n) {
| (Some(y), Some(x), Some(n)) => {
to_bincode_buffer(&special_functions::hermite_differential_equation(
&y, &x, &n,
))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_chebyshev_differential_equation(
y_buf: BincodeBuffer,
x_buf: BincodeBuffer,
n_buf: BincodeBuffer,
) -> BincodeBuffer {
let y: Option<Expr> = from_bincode_buffer(&y_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
let n: Option<Expr> = from_bincode_buffer(&n_buf);
match (y, x, n) {
| (Some(y), Some(x), Some(n)) => {
to_bincode_buffer(&special_functions::chebyshev_differential_equation(
&y, &x, &n,
))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_legendre_rodrigues_formula(
n_buf: BincodeBuffer,
x_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
match (n, x) {
| (Some(n), Some(x)) => {
to_bincode_buffer(&special_functions::legendre_rodrigues_formula(&n, &x))
},
| _ => BincodeBuffer::empty(),
}
}
#[unsafe(no_mangle)]
pub extern "C" fn rssn_bincode_hermite_rodrigues_formula(
n_buf: BincodeBuffer,
x_buf: BincodeBuffer,
) -> BincodeBuffer {
let n: Option<Expr> = from_bincode_buffer(&n_buf);
let x: Option<Expr> = from_bincode_buffer(&x_buf);
match (n, x) {
| (Some(n), Some(x)) => {
to_bincode_buffer(&special_functions::hermite_rodrigues_formula(&n, &x))
},
| _ => BincodeBuffer::empty(),
}
}