File tree Expand file tree Collapse file tree 4 files changed +22
-36
lines changed Expand file tree Collapse file tree 4 files changed +22
-36
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,5 @@ pub use masks::*;
3737mod vector;
3838pub use vector:: * ;
3939
40- mod libmf32;
4140mod array;
4241pub use array:: SimdArray ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -62,6 +62,20 @@ macro_rules! impl_float_vector {
6262 Self :: splat( 1.0 ) / self
6363 }
6464
65+ /// Calculate the sine of the angle
66+ #[ inline]
67+ pub fn sin( self ) -> Self {
68+ let x = Self :: splat( 1.0 / ( 3.14159265358 * 2.0 ) ) * self ;
69+ let x = x - x. floor( ) - 0.5 ;
70+ Self :: splat( 12.268859941019306 )
71+ . mul_add( x * x, Self :: splat( -41.216241051002875 ) )
72+ . mul_add( x * x, Self :: splat( 76.58672703334098 ) )
73+ . mul_add( x * x, Self :: splat( -81.59746095374902 ) )
74+ . mul_add( x * x, Self :: splat( 41.34151143437585 ) )
75+ . mul_add( x * x, Self :: splat( -6.283184525811273 ) )
76+ * x
77+ }
78+
6579 /// Converts each lane from radians to degrees.
6680 #[ inline]
6781 pub fn to_degrees( self ) -> Self {
Original file line number Diff line number Diff line change @@ -459,6 +459,14 @@ macro_rules! impl_float_tests {
459459 )
460460 }
461461
462+ fn sin<const LANES : usize >( ) {
463+ test_helpers:: test_unary_elementwise(
464+ & Vector :: <LANES >:: sin,
465+ & Scalar :: sin,
466+ & |_| true ,
467+ )
468+ }
469+
462470 fn to_degrees<const LANES : usize >( ) {
463471 test_helpers:: test_unary_elementwise(
464472 & Vector :: <LANES >:: to_degrees,
You can’t perform that action at this time.
0 commit comments