diff --git a/libm-test/src/precision.rs b/libm-test/src/precision.rs index 3fb8c1b37..c441922d3 100644 --- a/libm-test/src/precision.rs +++ b/libm-test/src/precision.rs @@ -1,8 +1,6 @@ //! Configuration for skipping or changing the result for individual test cases (inputs) rather //! than ignoring entire tests. -use core::f32; - use CheckBasis::{Mpfr, Musl}; use libm::support::CastFrom; use {BaseName as Bn, Identifier as Id}; diff --git a/libm/src/math/atan.rs b/libm/src/math/atan.rs index 0590ba87c..a303ebd42 100644 --- a/libm/src/math/atan.rs +++ b/libm/src/math/atan.rs @@ -29,8 +29,6 @@ * to produce the hexadecimal values shown. */ -use core::f64; - use super::fabs; const ATANHI: [f64; 4] = [ @@ -134,19 +132,19 @@ pub fn atan(x: f64) -> f64 { #[cfg(test)] mod tests { - use core::f64; + use core::f64::consts; use super::atan; #[test] fn sanity_check() { for (input, answer) in [ - (3.0_f64.sqrt() / 3.0, f64::consts::FRAC_PI_6), - (1.0, f64::consts::FRAC_PI_4), - (3.0_f64.sqrt(), f64::consts::FRAC_PI_3), - (-3.0_f64.sqrt() / 3.0, -f64::consts::FRAC_PI_6), - (-1.0, -f64::consts::FRAC_PI_4), - (-3.0_f64.sqrt(), -f64::consts::FRAC_PI_3), + (3.0_f64.sqrt() / 3.0, consts::FRAC_PI_6), + (1.0, consts::FRAC_PI_4), + (3.0_f64.sqrt(), consts::FRAC_PI_3), + (-3.0_f64.sqrt() / 3.0, -consts::FRAC_PI_6), + (-1.0, -consts::FRAC_PI_4), + (-3.0_f64.sqrt(), -consts::FRAC_PI_3), ] .iter() { @@ -167,12 +165,12 @@ mod tests { #[test] fn infinity() { - assert_eq!(atan(f64::INFINITY), f64::consts::FRAC_PI_2); + assert_eq!(atan(f64::INFINITY), consts::FRAC_PI_2); } #[test] fn minus_infinity() { - assert_eq!(atan(f64::NEG_INFINITY), -f64::consts::FRAC_PI_2); + assert_eq!(atan(f64::NEG_INFINITY), -consts::FRAC_PI_2); } #[test] diff --git a/libm/src/math/cbrtf.rs b/libm/src/math/cbrtf.rs index 9d6958483..6916ca673 100644 --- a/libm/src/math/cbrtf.rs +++ b/libm/src/math/cbrtf.rs @@ -17,8 +17,6 @@ * Return cube root of x */ -use core::f32; - const B1: u32 = 709958130; /* B1 = (127-127.0/3-0.03306235651)*2**23 */ const B2: u32 = 642849266; /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */ diff --git a/libm/src/math/expm1.rs b/libm/src/math/expm1.rs index 3714bf3af..3ce1d886b 100644 --- a/libm/src/math/expm1.rs +++ b/libm/src/math/expm1.rs @@ -10,8 +10,6 @@ * ==================================================== */ -use core::f64; - const O_THRESHOLD: f64 = 7.09782712893383973096e+02; /* 0x40862E42, 0xFEFA39EF */ const LN2_HI: f64 = 6.93147180369123816490e-01; /* 0x3fe62e42, 0xfee00000 */ const LN2_LO: f64 = 1.90821492927058770002e-10; /* 0x3dea39ef, 0x35793c76 */ diff --git a/libm/src/math/hypot.rs b/libm/src/math/hypot.rs index b92ee18ca..c0b2a1937 100644 --- a/libm/src/math/hypot.rs +++ b/libm/src/math/hypot.rs @@ -1,5 +1,3 @@ -use core::f64; - use super::sqrt; const SPLIT: f64 = 134217728. + 1.; // 0x1p27 + 1 === (2 ^ 27) + 1 diff --git a/libm/src/math/hypotf.rs b/libm/src/math/hypotf.rs index e7635ffc9..dfb36d4b2 100644 --- a/libm/src/math/hypotf.rs +++ b/libm/src/math/hypotf.rs @@ -1,5 +1,3 @@ -use core::f32; - use super::sqrtf; #[cfg_attr(assert_no_panic, no_panic::no_panic)] diff --git a/libm/src/math/log10.rs b/libm/src/math/log10.rs index 29f25d944..228c00a5b 100644 --- a/libm/src/math/log10.rs +++ b/libm/src/math/log10.rs @@ -17,8 +17,6 @@ * log10(x) = (f - f*f/2 + r)/log(10) + k*log10(2) */ -use core::f64; - const IVLN10HI: f64 = 4.34294481878168880939e-01; /* 0x3fdbcb7b, 0x15200000 */ const IVLN10LO: f64 = 2.50829467116452752298e-11; /* 0x3dbb9438, 0xca9aadd5 */ const LOG10_2HI: f64 = 3.01029995663611771306e-01; /* 0x3FD34413, 0x509F6000 */ diff --git a/libm/src/math/log10f.rs b/libm/src/math/log10f.rs index f89584bf9..f72fcf9e1 100644 --- a/libm/src/math/log10f.rs +++ b/libm/src/math/log10f.rs @@ -13,8 +13,6 @@ * See comments in log10.c. */ -use core::f32; - const IVLN10HI: f32 = 4.3432617188e-01; /* 0x3ede6000 */ const IVLN10LO: f32 = -3.1689971365e-05; /* 0xb804ead9 */ const LOG10_2HI: f32 = 3.0102920532e-01; /* 0x3e9a2080 */ diff --git a/libm/src/math/log1p.rs b/libm/src/math/log1p.rs index c991cce60..c2f9eb89b 100644 --- a/libm/src/math/log1p.rs +++ b/libm/src/math/log1p.rs @@ -53,8 +53,6 @@ * See HP-15C Advanced Functions Handbook, p.193. */ -use core::f64; - const LN2_HI: f64 = 6.93147180369123816490e-01; /* 3fe62e42 fee00000 */ const LN2_LO: f64 = 1.90821492927058770002e-10; /* 3dea39ef 35793c76 */ const LG1: f64 = 6.666666666666735130e-01; /* 3FE55555 55555593 */ diff --git a/libm/src/math/log1pf.rs b/libm/src/math/log1pf.rs index 89a92fac9..2e4775b8d 100644 --- a/libm/src/math/log1pf.rs +++ b/libm/src/math/log1pf.rs @@ -10,8 +10,6 @@ * ==================================================== */ -use core::f32; - const LN2_HI: f32 = 6.9313812256e-01; /* 0x3f317180 */ const LN2_LO: f32 = 9.0580006145e-06; /* 0x3717f7d1 */ /* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ diff --git a/libm/src/math/log2.rs b/libm/src/math/log2.rs index 9b750c9a2..0f72fe0b8 100644 --- a/libm/src/math/log2.rs +++ b/libm/src/math/log2.rs @@ -17,8 +17,6 @@ * log2(x) = (f - f*f/2 + r)/log(2) + k */ -use core::f64; - const IVLN2HI: f64 = 1.44269504072144627571e+00; /* 0x3ff71547, 0x65200000 */ const IVLN2LO: f64 = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ const LG1: f64 = 6.666666666666735130e-01; /* 3FE55555 55555593 */ diff --git a/libm/src/math/log2f.rs b/libm/src/math/log2f.rs index 0e5177d7a..78673675a 100644 --- a/libm/src/math/log2f.rs +++ b/libm/src/math/log2f.rs @@ -13,8 +13,6 @@ * See comments in log2.c. */ -use core::f32; - const IVLN2HI: f32 = 1.4428710938e+00; /* 0x3fb8b000 */ const IVLN2LO: f32 = -1.7605285393e-04; /* 0xb9389ad4 */ /* |(log(1+s)-log(1-s))/s - Lg(s)| < 2**-34.24 (~[-4.95e-11, 4.97e-11]). */ diff --git a/libm/src/math/rem_pio2f.rs b/libm/src/math/rem_pio2f.rs index 0472a1035..481f7ee83 100644 --- a/libm/src/math/rem_pio2f.rs +++ b/libm/src/math/rem_pio2f.rs @@ -14,8 +14,6 @@ * ==================================================== */ -use core::f64; - use super::rem_pio2_large; const TOINT: f64 = 1.5 / f64::EPSILON;