sin_cos_pi_f32(ctx, x).1
}
+/// computes `(sin(pi * x), cos(pi * x))`
+/// not guaranteed to give correct sign for zero results
+/// has an error of up to 2ULP
+pub fn sin_cos_pi_f64<Ctx: Context>(ctx: Ctx, x: Ctx::VecF64) -> (Ctx::VecF64, Ctx::VecF64) {
+ sin_cos_pi_impl(ctx, x, sin_pi_kernel_f64, cos_pi_kernel_f64)
+}
+
+/// computes `sin(pi * x)`
+/// not guaranteed to give correct sign for zero results
+/// has an error of up to 2ULP
+pub fn sin_pi_f64<Ctx: Context>(ctx: Ctx, x: Ctx::VecF64) -> Ctx::VecF64 {
+ sin_cos_pi_f64(ctx, x).0
+}
+
+/// computes `cos(pi * x)`
+/// not guaranteed to give correct sign for zero results
+/// has an error of up to 2ULP
+pub fn cos_pi_f64<Ctx: Context>(ctx: Ctx, x: Ctx::VecF64) -> Ctx::VecF64 {
+ sin_cos_pi_f64(ctx, x).1
+}
+
#[cfg(test)]
mod tests {
use super::*;
);
}
}
+
+ #[test]
+ #[cfg(feature = "full_tests")]
+ fn test_sin_pi_f64() {
+ for bits in (0..=u32::MAX).step_by(1 << 7) {
+ check_ulp(
+ f32::from_bits(bits) as f64,
+ sin_cos_pi_check_ulp_callback,
+ |x| sin_pi_f64(Scalar, Value(x)).0,
+ |x| reference_sin_cos_pi_f64(x).0,
+ );
+ }
+ }
+
+ #[test]
+ #[cfg(feature = "full_tests")]
+ fn test_cos_pi_f64() {
+ for bits in (0..=u32::MAX).step_by(1 << 7) {
+ check_ulp(
+ f32::from_bits(bits) as f64,
+ sin_cos_pi_check_ulp_callback,
+ |x| cos_pi_f64(Scalar, Value(x)).0,
+ |x| reference_sin_cos_pi_f64(x).1,
+ )
+ }
+ }
}