slatec 0.1.0

Safe Rust interface to selected SLATEC numerical routines
1
2
3
4
5
6
7
8
9
10
11
12
use crate::special::{SpecialFunctionError, runtime};
use slatec_sys::special::airy as raw;

/// Single-precision Airy Bi on the safe envelope, using `BI`.
pub fn airy_bi_f32(x: f32) -> Result<f32, SpecialFunctionError> {
    runtime::bounded_f32("airy_bi_f32", "x", x, 20.0)?;
    let _guard = runtime::lock_fnlib();
    let mut x = x;
    // Safety: conservative Airy input range, valid scalar pointer, and the
    // corrected single-precision FNLIB runtime profile.
    Ok(unsafe { raw::bi(&mut x) })
}