Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions libm-test/src/precision.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
20 changes: 9 additions & 11 deletions libm/src/math/atan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
* to produce the hexadecimal values shown.
*/

use core::f64;

use super::fabs;

const ATANHI: [f64; 4] = [
Expand Down Expand Up @@ -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()
{
Expand All @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/cbrtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/expm1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/hypot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use core::f64;

use super::sqrt;

const SPLIT: f64 = 134217728. + 1.; // 0x1p27 + 1 === (2 ^ 27) + 1
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/hypotf.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use core::f32;

use super::sqrtf;

#[cfg_attr(assert_no_panic, no_panic::no_panic)]
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log10f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log1p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log1pf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]). */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/log2f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]). */
Expand Down
2 changes: 0 additions & 2 deletions libm/src/math/rem_pio2f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* ====================================================
*/

use core::f64;

use super::rem_pio2_large;

const TOINT: f64 = 1.5 / f64::EPSILON;
Expand Down