add erf, erff, erfc, erfcf functions

This commit is contained in:
HTG-YT 2021-08-07 13:29:47 +08:00
parent cd890a1ecd
commit cb2ec7a2be
5 changed files with 65 additions and 1 deletions

View file

@ -58,3 +58,11 @@ pub mod cosf;
pub mod cosh;
#[path = "math/coshf.rs"]
pub mod coshf;
#[path = "math/erf.rs"]
pub mod erf;
#[path = "math/erfc.rs"]
pub mod erfc;
#[path = "math/erfcf.rs"]
pub mod erfcf;
#[path = "math/erff.rs"]
pub mod erff;

14
src/math/erf.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/erf.rs
*
* The erf function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn erf(x: f64) -> f64 {
libm::erf(x)
}

14
src/math/erfc.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/erfc.rs
*
* The erfc function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn erfc(x: f64) -> f64 {
libm::erfc(x)
}

14
src/math/erfcf.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/erfcf.rs
*
* The erfcf function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn erfcf(x: f32) -> f32 {
libm::erfcf(x)
}

14
src/math/erff.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/erff.rs
*
* The erff function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn erff(x: f32) -> f32 {
libm::erff(x)
}