@@ -4,7 +4,7 @@ use crate::bounded::{NonNegative, UnitInterval};
44use crate :: error:: { Error , Result } ;
55use crate :: kernel:: circular_vectoring;
66use crate :: ops:: algebraic:: sqrt_nonneg;
7- use crate :: tables:: chebyshev:: { horner , COS_Q_HI , COS_Q_LO , SIN_P_HI , SIN_P_LO } ;
7+ use crate :: tables:: chebyshev:: { COS_Q_HI , COS_Q_LO , SIN_P_HI , SIN_P_LO , horner } ;
88use crate :: traits:: CordicNumber ;
99
1010/// Sine and cosine. More efficient than separate calls. Accepts any angle.
@@ -68,17 +68,13 @@ pub fn sin_cos<T: CordicNumber>(angle: T) -> (T, T) {
6868 let ( sp_val, cp_val) = if T :: frac_bits ( ) >= 24 {
6969 // High precision: degree 15 sin, degree 14 cos
7070 let sp = horner ( & SIN_P_HI , u) ;
71- let sin_approx = poly_arg. saturating_add (
72- poly_arg. saturating_mul ( u) . saturating_mul ( sp) ,
73- ) ;
71+ let sin_approx = poly_arg. saturating_add ( poly_arg. saturating_mul ( u) . saturating_mul ( sp) ) ;
7472 let cp = horner ( & COS_Q_HI , u) ;
7573 ( sin_approx, one. saturating_add ( u. saturating_mul ( cp) ) )
7674 } else {
7775 // Low precision: degree 9 sin, degree 8 cos
7876 let sp = horner ( & SIN_P_LO , u) ;
79- let sin_approx = poly_arg. saturating_add (
80- poly_arg. saturating_mul ( u) . saturating_mul ( sp) ,
81- ) ;
77+ let sin_approx = poly_arg. saturating_add ( poly_arg. saturating_mul ( u) . saturating_mul ( sp) ) ;
8278 let cp = horner ( & COS_Q_LO , u) ;
8379 ( sin_approx, one. saturating_add ( u. saturating_mul ( cp) ) )
8480 } ;
0 commit comments