Move non-public functions to pub(crate)
Remove exceptions from the test list after doing so
This commit is contained in:
@@ -27,20 +27,7 @@ mod musl_reference_tests {
|
||||
// These files are all internal functions or otherwise miscellaneous, not
|
||||
// defining a function we want to test.
|
||||
const IGNORED_FILES: &[&str] = &[
|
||||
"expo2.rs", // kernel, private
|
||||
"fenv.rs",
|
||||
"k_cos.rs", // kernel, private
|
||||
"k_cosf.rs", // kernel, private
|
||||
"k_expo2.rs", // kernel, private
|
||||
"k_expo2f.rs", // kernel, private
|
||||
"k_sin.rs", // kernel, private
|
||||
"k_sinf.rs", // kernel, private
|
||||
"k_tan.rs", // kernel, private
|
||||
"k_tanf.rs", // kernel, private
|
||||
"mod.rs",
|
||||
"rem_pio2.rs", // kernel, private
|
||||
"rem_pio2_large.rs", // kernel, private
|
||||
"rem_pio2f.rs", // kernel, private
|
||||
"sincos.rs", // more than 1 result
|
||||
"sincosf.rs", // more than 1 result
|
||||
"jn.rs", // passed, but very slow
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ use super::{combine_words, exp};
|
||||
/* exp(x)/2 for x >= log(DBL_MAX), slightly better than 0.5*exp(x/2)*exp(x/2) */
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn expo2(x: f64) -> f64 {
|
||||
pub(crate) fn expo2(x: f64) -> f64 {
|
||||
/* k is such that k*ln2 has minimal relative error and x - kln2 > log(DBL_MIN) */
|
||||
const K: i32 = 2043;
|
||||
let kln2 = f64::from_bits(0x40962066151add8b);
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ const C6: f64 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
|
||||
// any extra precision in w.
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_cos(x: f64, y: f64) -> f64 {
|
||||
pub(crate) fn k_cos(x: f64, y: f64) -> f64 {
|
||||
let z = x * x;
|
||||
let w = z * z;
|
||||
let r = z * (C1 + z * (C2 + z * C3)) + w * w * (C4 + z * (C5 + z * C6));
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const C3: f64 = 0.0000243904487962774090654; /* 0x199342e0ee5069.0p-68 */
|
||||
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_cosf(x: f64) -> f32 {
|
||||
pub(crate) fn k_cosf(x: f64) -> f32 {
|
||||
let z = x * x;
|
||||
let w = z * z;
|
||||
let r = C2 + z * C3;
|
||||
|
||||
@@ -6,7 +6,7 @@ const K: i32 = 235;
|
||||
/* expf(x)/2 for x >= log(FLT_MAX), slightly better than 0.5f*expf(x/2)*expf(x/2) */
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_expo2f(x: f32) -> f32 {
|
||||
pub(crate) fn k_expo2f(x: f32) -> f32 {
|
||||
let k_ln2 = f32::from_bits(0x4322e3bc);
|
||||
/* note that k is odd and scale*scale overflows */
|
||||
let scale = f32::from_bits(((0x7f + K / 2) as u32) << 23);
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ const S6: f64 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */
|
||||
// sin(x) = x + (S1*x + (x *(r-y/2)+y))
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_sin(x: f64, y: f64, iy: i32) -> f64 {
|
||||
pub(crate) fn k_sin(x: f64, y: f64, iy: i32) -> f64 {
|
||||
let z = x * x;
|
||||
let w = z * z;
|
||||
let r = S2 + z * (S3 + z * S4) + z * w * (S5 + z * S6);
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const S4: f64 = 0.0000027183114939898219064; /* 0x16cd878c3b46a7.0p-71 */
|
||||
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_sinf(x: f64) -> f32 {
|
||||
pub(crate) fn k_sinf(x: f64) -> f32 {
|
||||
let z = x * x;
|
||||
let w = z * z;
|
||||
let r = S3 + z * S4;
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ const PIO4_LO: f64 = 3.06161699786838301793e-17; /* 3C81A626, 33145C07 */
|
||||
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_tan(mut x: f64, mut y: f64, odd: i32) -> f64 {
|
||||
pub(crate) fn k_tan(mut x: f64, mut y: f64, odd: i32) -> f64 {
|
||||
let hx = (f64::to_bits(x) >> 32) as u32;
|
||||
let big = (hx & 0x7fffffff) >= 0x3FE59428; /* |x| >= 0.6744 */
|
||||
if big {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ const T: [f64; 6] = [
|
||||
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn k_tanf(x: f64, odd: bool) -> f32 {
|
||||
pub(crate) fn k_tanf(x: f64, odd: bool) -> f32 {
|
||||
let z = x * x;
|
||||
/*
|
||||
* Split up the polynomial into small independent terms to give
|
||||
|
||||
@@ -43,7 +43,7 @@ const PIO2_3T: f64 = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
|
||||
// caller must handle the case when reduction is not needed: |x| ~<= pi/4 */
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn rem_pio2(x: f64) -> (i32, f64, f64) {
|
||||
pub(crate) fn rem_pio2(x: f64) -> (i32, f64, f64) {
|
||||
let x1p24 = f64::from_bits(0x4170000000000000);
|
||||
|
||||
let sign = (f64::to_bits(x) >> 63) as i32;
|
||||
|
||||
@@ -224,11 +224,11 @@ const PIO2: [f64; 8] = [
|
||||
/// independent of the exponent of the input.
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn rem_pio2_large(x: &[f64], y: &mut [f64], e0: i32, prec: usize) -> i32 {
|
||||
pub(crate) fn rem_pio2_large(x: &[f64], y: &mut [f64], e0: i32, prec: usize) -> i32 {
|
||||
let x1p24 = f64::from_bits(0x4170000000000000); // 0x1p24 === 2 ^ 24
|
||||
let x1p_24 = f64::from_bits(0x3e70000000000000); // 0x1p_24 === 2 ^ (-24)
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
#[cfg(all(target_pointer_width = "64", feature = "checked"))]
|
||||
assert!(e0 <= 16360);
|
||||
|
||||
let nx = x.len();
|
||||
|
||||
@@ -33,7 +33,7 @@ const PIO2_1T: f64 = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */
|
||||
/// use __rem_pio2_large() for large x
|
||||
#[inline]
|
||||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
|
||||
pub fn rem_pio2f(x: f32) -> (i32, f64) {
|
||||
pub(crate) fn rem_pio2f(x: f32) -> (i32, f64) {
|
||||
let x64 = x as f64;
|
||||
|
||||
let mut tx: [f64; 1] = [0.];
|
||||
|
||||
Reference in New Issue
Block a user