add erf, erff, erfc, erfcf functions

pull/1/head
HTG-YT 2021-08-07 13:29:47 +08:00
parent 3b988ea0d7
commit 4ddc856fa6
5 changed files with 65 additions and 1 deletions

View File

@ -57,4 +57,12 @@ pub mod cosf;
#[path = "math/cosh.rs"]
pub mod cosh;
#[path = "math/coshf.rs"]
pub mod coshf;
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)
}