1 /* origin: FreeBSD /usr/src/lib/msun/src/s_sin.c */
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
10 * ====================================================
16 void sincos(double x
, double *sin
, double *cos
)
26 if (ix
<= 0x3fe921fb) {
27 /* if |x| < 2**-27 * sqrt(2) */
28 if (ix
< 0x3e46a09e) {
29 /* raise inexact if x!=0 and underflow if subnormal */
30 FORCE_EVAL(ix
< 0x00100000 ? x
/0x1p
120f
: x
+0x1p
120f
);
35 *sin
= __sin(x
, 0.0, 0);
40 /* sincos(Inf or NaN) is NaN */
41 if (ix
>= 0x7ff00000) {
46 /* argument reduction needed */
48 s
= __sin(y
[0], y
[1], 1);
49 c
= __cos(y
[0], y
[1]);