2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
9 #include "math_private.h"
11 void sincos(double x
, double *sin
, double *cos
)
21 if(ix
<= 0x3fe921fb) {
22 if(ix
<0x3e400000) /* |x| < 2**-27 */
23 {if((int)x
==0) { *sin
=x
; *cos
=1.0; return; }} /* generate inexact */
24 *sin
= __kernel_sin(x
,z
,0);
25 *cos
= __kernel_cos(x
,z
);
29 /* cos(Inf or NaN) is NaN */
30 else if (ix
>=0x7ff00000) {*sin
= *cos
= x
-x
; return; }
32 /* argument reduction needed */
34 n
= __ieee754_rem_pio2(x
,y
);
36 case 0: *sin
= __kernel_sin(y
[0],y
[1],1); *cos
= __kernel_cos(y
[0],y
[1]); break;
37 case 1: *sin
= __kernel_cos(y
[0],y
[1]); *cos
= -__kernel_sin(y
[0],y
[1],1); break;
38 case 2: *sin
= -__kernel_sin(y
[0],y
[1],1); *cos
= -__kernel_cos(y
[0],y
[1]); break;
40 *sin
= -__kernel_cos(y
[0],y
[1]); *cos
= __kernel_sin(y
[0],y
[1],1);