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 * ====================================================
15 void sincos(double x, double *sin, double *cos)
25 if (ix <= 0x3fe921fb) {
26 /* if |x| < 2**-27 * sqrt(2) */
27 if (ix < 0x3e46a09e) {
28 /* raise inexact if x!=0 and underflow if subnormal */
29 FORCE_EVAL(ix < 0x00100000 ? x/0x1p120f : x+0x1p120f);
34 *sin = __sin(x, 0.0, 0);
39 /* sincos(Inf or NaN) is NaN */
40 if (ix >= 0x7ff00000) {
45 /* argument reduction needed */
47 s = __sin(y[0], y[1], 1);
48 c = __cos(y[0], y[1]);