diff --git a/include/kfr/math/impl/sin_cos.hpp b/include/kfr/math/impl/sin_cos.hpp index b0e2426d..7065169d 100644 --- a/include/kfr/math/impl/sin_cos.hpp +++ b/include/kfr/math/impl/sin_cos.hpp @@ -65,9 +65,8 @@ KFR_INTRINSIC vec trig_fold(const vec& x, vec, N>& quadrant quadrant = broadcastto>(broadcastto(y - floor(y * T(1.0 / 16.0)) * T(16.0))); const vec, N> odd = (quadrant & 1); - quadrant = quadrant + odd; + quadrant = (quadrant + odd) & itype(7); y = y + cast(odd); - quadrant = quadrant & 7; constexpr T hi = constants::fold_constant_hi; constexpr T rem1 = constants::fold_constant_rem1;