diff --git a/crates/std_float/src/lib.rs b/crates/std_float/src/lib.rs index 1fdc10f955c..d8f55b5dc71 100644 --- a/crates/std_float/src/lib.rs +++ b/crates/std_float/src/lib.rs @@ -121,7 +121,7 @@ pub trait StdFloat: Sealed + Sized { fn fract(self) -> Self; } -pub trait StdLibm : StdFloat { +pub trait StdLibm: StdFloat { type IntType; type UintType; @@ -148,15 +148,15 @@ pub trait StdLibm : StdFloat { fn log2(self) -> Self; fn ln_1p(self) -> Self; - + fn ln(self) -> Self; - + fn log10(self) -> Self; - + fn log(self, base: Self) -> Self; - + fn powf(self, y: Self) -> Self; - + fn powi(self, y: Self::IntType) -> Self; fn sinh(self) -> Self; diff --git a/crates/std_float/src/libm32.rs b/crates/std_float/src/libm32.rs index e773cead4ca..45a61d5068a 100644 --- a/crates/std_float/src/libm32.rs +++ b/crates/std_float/src/libm32.rs @@ -1,5 +1,5 @@ #![allow(non_snake_case)] -#![doc("This code is automatically generated, do not edit.")] +//! This code is automatically generated, do not edit. use super::StdLibm; use super::StdFloat; @@ -152,7 +152,7 @@ where .mul_add(x, Self::splat(0.009617995f32)) .mul_add(x, Self::splat(0.05550411f32)) .mul_add(x, Self::splat(0.24022652f32)) - .mul_add(x, Self::splat(0.6931472f32)) + .mul_add(x, Self::splat(core::f32::consts::LN_2)) .mul_add(x, Self::splat(1f32)) * mul; let y1 = ((arg).lanes_gt(EXP2_MAX)).select(INFINITY, y); @@ -180,7 +180,7 @@ where .mul_add(x, Self::splat(0.009617995f32)) .mul_add(x, Self::splat(0.05550411f32)) .mul_add(x, Self::splat(0.24022652f32)) - .mul_add(x, Self::splat(0.6931472f32)) + .mul_add(x, Self::splat(core::f32::consts::LN_2)) .mul_add(x, -Self::splat(0.00000000008090348f32)) * mul + (mul - Self::splat(1.0)) @@ -285,7 +285,7 @@ where .mul_add(x * x, Self::splat(0.05285888f32)) .mul_add(x * x, Self::splat(0.13475448f32)) .mul_add(x * x, Self::splat(0.55773664f32)) - .mul_add(x * x, -Self::splat(0.7853982f32)) + .mul_add(x * x, -Self::splat(core::f32::consts::FRAC_PI_4)) * x; y * recip } diff --git a/crates/std_float/src/test_libm32.rs b/crates/std_float/src/test_libm32.rs index 5bf2fb0d16f..4213d355a0b 100644 --- a/crates/std_float/src/test_libm32.rs +++ b/crates/std_float/src/test_libm32.rs @@ -28,7 +28,6 @@ macro_rules! test_vec { }); } - macro_rules! test_range { ( min: $min: expr, @@ -38,7 +37,7 @@ macro_rules! test_range { vector_fn: $vector_fn: expr, scalar_type: $scalar_type: ty, vector_type: $vector_type: ty, - ) => ({ + ) => {{ let limit = <$vector_type>::splat($limit); let b = (($max) - ($min)) * (1.0 / NUM_ITER as $scalar_type); let a = $min; @@ -58,7 +57,7 @@ macro_rules! test_range { x: x, ) } - }); + }}; ( value: $value: expr, limit: $limit: expr, @@ -66,7 +65,7 @@ macro_rules! test_range { vector_fn: $vector_fn: expr, scalar_type: $scalar_type: ty, vector_type: $vector_type: ty, - ) => ({ + ) => {{ let limit = <$vector_type>::splat($value); let x = <$vector_type>::splat($value); test_vec!( @@ -76,7 +75,7 @@ macro_rules! test_range { limit: limit, x: x, ) - }); + }}; } #[test]