File tree 4 files changed +22
-36
lines changed
4 files changed +22
-36
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,5 @@ pub use masks::*;
37
37
mod vector;
38
38
pub use vector:: * ;
39
39
40
- mod libmf32;
41
40
mod array;
42
41
pub 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 {
62
62
Self :: splat( 1.0 ) / self
63
63
}
64
64
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
+
65
79
/// Converts each lane from radians to degrees.
66
80
#[ inline]
67
81
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 {
459
459
)
460
460
}
461
461
462
+ fn sin<const LANES : usize >( ) {
463
+ test_helpers:: test_unary_elementwise(
464
+ & Vector :: <LANES >:: sin,
465
+ & Scalar :: sin,
466
+ & |_| true ,
467
+ )
468
+ }
469
+
462
470
fn to_degrees<const LANES : usize >( ) {
463
471
test_helpers:: test_unary_elementwise(
464
472
& Vector :: <LANES >:: to_degrees,
You can’t perform that action at this time.
0 commit comments