diff --git a/Cargo.toml b/Cargo.toml index 28d6236..414b321 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" readme = "README.md" [dependencies.doubled] -version = "0.3.1" +version = "0.3.2" features = ["simd"] [features] diff --git a/src/f32x.rs b/src/f32x.rs index 7e73e2c..8203b66 100644 --- a/src/f32x.rs +++ b/src/f32x.rs @@ -5,6 +5,8 @@ pub(crate) use tst::*; mod constants; pub(crate) use constants::*; +use core::simd::prelude::*; + /// Fast functions with 350.0 ULP error bound mod fast; pub use fast::{cosf as cos_fast, powf as pow_fast, sinf as sin_fast}; @@ -49,9 +51,7 @@ pub use u35::{ use crate::common::*; use doubled::*; -use core::simd::{ - LaneCount, Mask, Simd, SimdFloat, SimdPartialEq, SimdPartialOrd, SupportedLaneCount, -}; +use core::simd::{LaneCount, Mask, Simd, SupportedLaneCount}; type F32x = Simd; type U32x = Simd; diff --git a/src/f64.rs b/src/f64.rs index 2eb7535..72c767e 100644 --- a/src/f64.rs +++ b/src/f64.rs @@ -716,12 +716,8 @@ pub fn ldexp(x: f64, mut exp: i32) -> f64 { /// Integer exponent of an FP number pub fn ilogb(d: f64) -> i32 { let mut e = ilogbk(fabsk(d)); - e = if d == 0. { SLEEF_FP_ILOGB0 as i32 } else { e }; - e = if d.is_nan() { - SLEEF_FP_ILOGBNAN as i32 - } else { - e - }; + e = if d == 0. { SLEEF_FP_ILOGB0 } else { e }; + e = if d.is_nan() { SLEEF_FP_ILOGBNAN } else { e }; if d.is_infinite() { i32::MAX } else { diff --git a/src/f64/u10.rs b/src/f64/u10.rs index 9e6e4f6..39cdc1f 100644 --- a/src/f64/u10.rs +++ b/src/f64/u10.rs @@ -147,7 +147,7 @@ pub fn cos(d: f64) -> f64 { let u = t.mul_as_f(x); - if ((ql as isize) & 2) == 0 { + if (ql & 2) == 0 { -u } else { u diff --git a/src/f64x.rs b/src/f64x.rs index e21589e..1cabd8b 100644 --- a/src/f64x.rs +++ b/src/f64x.rs @@ -5,6 +5,8 @@ pub(crate) use tst::*; mod constants; pub(crate) use constants::*; +use core::simd::prelude::*; + /// Functions with 0.5 ULP error bound mod u05; pub use u05::{ @@ -41,9 +43,7 @@ pub use u35::{ }; use crate::common::*; -use core::simd::{ - LaneCount, Mask, Simd, SimdFloat, SimdPartialEq, SimdPartialOrd, SupportedLaneCount, -}; +use core::simd::{LaneCount, Mask, Simd, SupportedLaneCount}; use doubled::*; type F64x = Simd;