| /* origin: FreeBSD /usr/src/lib/msun/src/s_sin.c */ |
| * ==================================================== |
| * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
| * Developed at SunPro, a Sun Microsystems, Inc. business. |
| * Permission to use, copy, modify, and distribute this |
| * software is freely granted, provided that this notice |
| * ==================================================== |
| use super::{get_high_word, k_cos, k_sin, rem_pio2}; |
| pub fn sincos(x: f64) -> (f64, f64) { |
| /* if |x| < 2**-27 * sqrt(2) */ |
| /* raise inexact if x!=0 and underflow if subnormal */ |
| let x1p120 = f64::from_bits(0x4770000000000000); // 0x1p120 == 2^120 |
| return (k_sin(x, 0.0, 0), k_cos(x, 0.0)); |
| /* sincos(Inf or NaN) is NaN */ |
| /* argument reduction needed */ |
| let (n, y0, y1) = rem_pio2(x); |
| #[cfg(feature = "checked")] |
| #[cfg(not(feature = "checked"))] |