4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #include <sys/isa_defs.h>
31 #include <sys/ccompile.h>
34 #define HI(x) *(1+(int*)x)
35 #define LO(x) *(unsigned*)x
37 #define HI(x) *(int*)x
38 #define LO(x) *(1+(unsigned*)x)
42 #define restrict _Restrict
47 extern const double __vlibm_TBL_sincos_hi
[], __vlibm_TBL_sincos_lo
[];
50 half
[2] = { 0.5, -0.5 },
52 invpio2
= 0.636619772367581343075535,
53 pio2_1
= 1.570796326734125614166,
54 pio2_2
= 6.077100506303965976596e-11,
55 pio2_3
= 2.022266248711166455796e-21,
56 pio2_3t
= 8.478427660368899643959e-32,
57 pp1
= -1.666666666605760465276263943134982554676e-0001,
58 pp2
= 8.333261209690963126718376566146180944442e-0003,
59 qq1
= -4.999999999977710986407023955908711557870e-0001,
60 qq2
= 4.166654863857219350645055881018842089580e-0002,
61 poly1
[2]= { -1.666666666666629669805215138920301589656e-0001,
62 -4.999999999999931701464060878888294524481e-0001 },
63 poly2
[2]= { 8.333333332390951295683993455280336376663e-0003,
64 4.166666666394861917535640593963708222319e-0002 },
65 poly3
[2]= { -1.984126237997976692791551778230098403960e-0004,
66 -1.388888552656142867832756687736851681462e-0003 },
67 poly4
[2]= { 2.753403624854277237649987622848330351110e-0006,
68 2.478519423681460796618128289454530524759e-0005 };
70 static const unsigned thresh
[2] = { 0x3fc90000, 0x3fc40000 };
72 /* Don't __ the following; acomp will handle it */
73 extern double fabs(double);
74 extern void __vlibm_vsin_big(int, double *, int, double *, int, int);
77 __vsin(int n
, double * restrict x
, int stridex
, double * restrict y
,
80 double x0_or_one
[4], x1_or_one
[4], x2_or_one
[4];
81 double y0_or_zero
[4], y1_or_zero
[4], y2_or_zero
[4];
82 double x0
, x1
, x2
, *py0
= 0, *py1
= 0, *py2
, *xsave
, *ysave
;
83 unsigned hx0
, hx1
, hx2
, xsb0
, xsb1
= 0, xsb2
;
84 int i
, biguns
, nsave
, sxsave
, sysave
;
85 volatile int v __unused
;
93 x0
= *x
; /* error: 'x0' may be used uninitialized */
98 hx0
= xsb0
& ~0x80000000;
104 if (hx0
< 0x3e400000)
125 hx1
= xsb1
& ~0x80000000;
126 if (hx1
> 0x3fe921fb)
131 if (hx1
< 0x3e400000)
152 hx2
= xsb2
& ~0x80000000;
153 if (hx2
> 0x3fe921fb)
158 if (hx2
< 0x3e400000)
172 i
= (hx0
- 0x3fc90000) >> 31;
173 i
|= ((hx1
- 0x3fc90000) >> 30) & 2;
174 i
|= ((hx2
- 0x3fc90000) >> 29) & 4;
177 double a0
, a1
, a2
, w0
, w1
, w2
;
178 double t0
, t1
, t2
, z0
, z1
, z2
;
182 j0
= (xsb0
+ 0x4000) & 0xffff8000;
183 j1
= (xsb1
+ 0x4000) & 0xffff8000;
184 j2
= (xsb2
+ 0x4000) & 0xffff8000;
197 t0
= z0
* (qq1
+ z0
* qq2
);
198 t1
= z1
* (qq1
+ z1
* qq2
);
199 t2
= z2
* (qq1
+ z2
* qq2
);
200 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
201 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
202 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
203 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
204 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
205 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
206 xsb0
= (xsb0
>> 30) & 2;
207 xsb1
= (xsb1
>> 30) & 2;
208 xsb2
= (xsb2
>> 30) & 2;
209 a0
= __vlibm_TBL_sincos_hi
[j0
+xsb0
];
210 a1
= __vlibm_TBL_sincos_hi
[j1
+xsb1
];
211 a2
= __vlibm_TBL_sincos_hi
[j2
+xsb2
];
212 t0
= (__vlibm_TBL_sincos_hi
[j0
+1] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+xsb0
];
213 t1
= (__vlibm_TBL_sincos_hi
[j1
+1] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+xsb1
];
214 t2
= (__vlibm_TBL_sincos_hi
[j2
+1] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+xsb2
];
221 j1
= (xsb1
+ 0x4000) & 0xffff8000;
222 j2
= (xsb2
+ 0x4000) & 0xffff8000;
232 t0
= z0
* (poly3
[0] + z0
* poly4
[0]);
233 t1
= z1
* (qq1
+ z1
* qq2
);
234 t2
= z2
* (qq1
+ z2
* qq2
);
235 t0
= z0
* (poly1
[0] + z0
* (poly2
[0] + t0
));
236 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
237 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
238 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
239 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
240 xsb1
= (xsb1
>> 30) & 2;
241 xsb2
= (xsb2
>> 30) & 2;
242 a1
= __vlibm_TBL_sincos_hi
[j1
+xsb1
];
243 a2
= __vlibm_TBL_sincos_hi
[j2
+xsb2
];
245 t1
= (__vlibm_TBL_sincos_hi
[j1
+1] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+xsb1
];
246 t2
= (__vlibm_TBL_sincos_hi
[j2
+1] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+xsb2
];
253 j0
= (xsb0
+ 0x4000) & 0xffff8000;
254 j2
= (xsb2
+ 0x4000) & 0xffff8000;
264 t0
= z0
* (qq1
+ z0
* qq2
);
265 t1
= z1
* (poly3
[0] + z1
* poly4
[0]);
266 t2
= z2
* (qq1
+ z2
* qq2
);
267 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
268 t1
= z1
* (poly1
[0] + z1
* (poly2
[0] + t1
));
269 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
270 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
271 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
272 xsb0
= (xsb0
>> 30) & 2;
273 xsb2
= (xsb2
>> 30) & 2;
274 a0
= __vlibm_TBL_sincos_hi
[j0
+xsb0
];
275 a2
= __vlibm_TBL_sincos_hi
[j2
+xsb2
];
276 t0
= (__vlibm_TBL_sincos_hi
[j0
+1] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+xsb0
];
278 t2
= (__vlibm_TBL_sincos_hi
[j2
+1] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+xsb2
];
285 j2
= (xsb2
+ 0x4000) & 0xffff8000;
292 t0
= z0
* (poly3
[0] + z0
* poly4
[0]);
293 t1
= z1
* (poly3
[0] + z1
* poly4
[0]);
294 t2
= z2
* (qq1
+ z2
* qq2
);
295 t0
= z0
* (poly1
[0] + z0
* (poly2
[0] + t0
));
296 t1
= z1
* (poly1
[0] + z1
* (poly2
[0] + t1
));
297 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
298 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
299 xsb2
= (xsb2
>> 30) & 2;
300 a2
= __vlibm_TBL_sincos_hi
[j2
+xsb2
];
303 t2
= (__vlibm_TBL_sincos_hi
[j2
+1] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+xsb2
];
310 j0
= (xsb0
+ 0x4000) & 0xffff8000;
311 j1
= (xsb1
+ 0x4000) & 0xffff8000;
321 t0
= z0
* (qq1
+ z0
* qq2
);
322 t1
= z1
* (qq1
+ z1
* qq2
);
323 t2
= z2
* (poly3
[0] + z2
* poly4
[0]);
324 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
325 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
326 t2
= z2
* (poly1
[0] + z2
* (poly2
[0] + t2
));
327 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
328 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
329 xsb0
= (xsb0
>> 30) & 2;
330 xsb1
= (xsb1
>> 30) & 2;
331 a0
= __vlibm_TBL_sincos_hi
[j0
+xsb0
];
332 a1
= __vlibm_TBL_sincos_hi
[j1
+xsb1
];
333 t0
= (__vlibm_TBL_sincos_hi
[j0
+1] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+xsb0
];
334 t1
= (__vlibm_TBL_sincos_hi
[j1
+1] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+xsb1
];
342 j1
= (xsb1
+ 0x4000) & 0xffff8000;
349 t0
= z0
* (poly3
[0] + z0
* poly4
[0]);
350 t1
= z1
* (qq1
+ z1
* qq2
);
351 t2
= z2
* (poly3
[0] + z2
* poly4
[0]);
352 t0
= z0
* (poly1
[0] + z0
* (poly2
[0] + t0
));
353 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
354 t2
= z2
* (poly1
[0] + z2
* (poly2
[0] + t2
));
355 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
356 xsb1
= (xsb1
>> 30) & 2;
357 a1
= __vlibm_TBL_sincos_hi
[j1
+xsb1
];
359 t1
= (__vlibm_TBL_sincos_hi
[j1
+1] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+xsb1
];
367 j0
= (xsb0
+ 0x4000) & 0xffff8000;
374 t0
= z0
* (qq1
+ z0
* qq2
);
375 t1
= z1
* (poly3
[0] + z1
* poly4
[0]);
376 t2
= z2
* (poly3
[0] + z2
* poly4
[0]);
377 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
378 t1
= z1
* (poly1
[0] + z1
* (poly2
[0] + t1
));
379 t2
= z2
* (poly1
[0] + z2
* (poly2
[0] + t2
));
380 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
381 xsb0
= (xsb0
>> 30) & 2;
382 a0
= __vlibm_TBL_sincos_hi
[j0
+xsb0
];
383 t0
= (__vlibm_TBL_sincos_hi
[j0
+1] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+xsb0
];
395 t0
= z0
* (poly3
[0] + z0
* poly4
[0]);
396 t1
= z1
* (poly3
[0] + z1
* poly4
[0]);
397 t2
= z2
* (poly3
[0] + z2
* poly4
[0]);
398 t0
= z0
* (poly1
[0] + z0
* (poly2
[0] + t0
));
399 t1
= z1
* (poly1
[0] + z1
* (poly2
[0] + t1
));
400 t2
= z2
* (poly1
[0] + z2
* (poly2
[0] + t2
));
417 double a0
, a1
, w0
, w1
;
418 double t0
, t1
, z0
, z1
;
423 if (hx1
< 0x3fc90000)
426 t1
= z1
* (poly3
[0] + z1
* poly4
[0]);
427 t1
= z1
* (poly1
[0] + z1
* (poly2
[0] + t1
));
433 j1
= (xsb1
+ 0x4000) & 0xffff8000;
438 t1
= z1
* (qq1
+ z1
* qq2
);
439 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
440 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
441 xsb1
= (xsb1
>> 30) & 2;
442 a1
= __vlibm_TBL_sincos_hi
[j1
+xsb1
];
443 t1
= (__vlibm_TBL_sincos_hi
[j1
+1] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+xsb1
];
447 if (hx0
< 0x3fc90000)
450 t0
= z0
* (poly3
[0] + z0
* poly4
[0]);
451 t0
= z0
* (poly1
[0] + z0
* (poly2
[0] + t0
));
457 j0
= (xsb0
+ 0x4000) & 0xffff8000;
462 t0
= z0
* (qq1
+ z0
* qq2
);
463 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
464 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
465 xsb0
= (xsb0
>> 30) & 2;
466 a0
= __vlibm_TBL_sincos_hi
[j0
+xsb0
];
467 t0
= (__vlibm_TBL_sincos_hi
[j0
+1] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+xsb0
];
475 * MEDIUM RANGE PROCESSING
476 * Jump here at first sign of medium range argument. We are a bit
477 * confused due to the jump.. fix up several variables and jump into
478 * the nth loop, same as was being processed above.
503 else if (biguns
== 2)
513 double fn0
, fn1
, fn2
, a0
, a1
, a2
, w0
, w1
, w2
, y0
, y1
, y2
;
534 if (hx
>= 0x7ff00000)
573 if (hx
>= 0x7ff00000)
612 if (hx
>= 0x7ff00000)
629 n0
= (int) (x0
* invpio2
+ half
[xsb0
]);
630 n1
= (int) (x1
* invpio2
+ half
[xsb1
]);
631 n2
= (int) (x2
* invpio2
+ half
[xsb2
]);
638 a0
= x0
- fn0
* pio2_1
;
639 a1
= x1
- fn1
* pio2_1
;
640 a2
= x2
- fn2
* pio2_1
;
653 w0
= fn0
* pio2_3
- y0
;
654 w1
= fn1
* pio2_3
- y1
;
655 w2
= fn2
* pio2_3
- y2
;
665 w0
= fn0
* pio2_3t
- y0
;
666 w1
= fn1
* pio2_3t
- y1
;
667 w2
= fn2
* pio2_3t
- y2
;
675 i
= ((xsb0
& ~0x80000000) - thresh
[n0
&1]) >> 31;
677 i
|= (((xsb1
& ~0x80000000) - thresh
[n1
&1]) >> 30) & 2;
679 i
|= (((xsb2
& ~0x80000000) - thresh
[n2
&1]) >> 29) & 4;
682 double t0
, t1
, t2
, z0
, z1
, z2
;
686 j0
= (xsb0
+ 0x4000) & 0xffff8000;
687 j1
= (xsb1
+ 0x4000) & 0xffff8000;
688 j2
= (xsb2
+ 0x4000) & 0xffff8000;
701 t0
= z0
* (qq1
+ z0
* qq2
);
702 t1
= z1
* (qq1
+ z1
* qq2
);
703 t2
= z2
* (qq1
+ z2
* qq2
);
704 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
705 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
706 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
707 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
708 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
709 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
710 xsb0
= (xsb0
>> 30) & 2;
711 xsb1
= (xsb1
>> 30) & 2;
712 xsb2
= (xsb2
>> 30) & 2;
713 n0
^= (xsb0
& ~(n0
<< 1));
714 n1
^= (xsb1
& ~(n1
<< 1));
715 n2
^= (xsb2
& ~(n2
<< 1));
719 a0
= __vlibm_TBL_sincos_hi
[j0
+n0
];
720 a1
= __vlibm_TBL_sincos_hi
[j1
+n1
];
721 a2
= __vlibm_TBL_sincos_hi
[j2
+n2
];
722 t0
= (__vlibm_TBL_sincos_hi
[j0
+((n0
+xsb0
)&3)] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+n0
];
723 t1
= (__vlibm_TBL_sincos_hi
[j1
+((n1
+xsb1
)&3)] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+n1
];
724 t2
= (__vlibm_TBL_sincos_hi
[j2
+((n2
+xsb2
)&3)] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+n2
];
732 j1
= (xsb1
+ 0x4000) & 0xffff8000;
733 j2
= (xsb2
+ 0x4000) & 0xffff8000;
747 t0
= z0
* (poly3
[j0
] + z0
* poly4
[j0
]);
748 t1
= z1
* (qq1
+ z1
* qq2
);
749 t2
= z2
* (qq1
+ z2
* qq2
);
750 t0
= z0
* (poly1
[j0
] + z0
* (poly2
[j0
] + t0
));
751 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
752 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
753 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
754 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
755 xsb1
= (xsb1
>> 30) & 2;
756 xsb2
= (xsb2
>> 30) & 2;
757 n1
^= (xsb1
& ~(n1
<< 1));
758 n2
^= (xsb2
& ~(n2
<< 1));
761 a1
= __vlibm_TBL_sincos_hi
[j1
+n1
];
762 a2
= __vlibm_TBL_sincos_hi
[j2
+n2
];
763 t0
= x0_or_one
[n0
] + (y0_or_zero
[n0
] + x0_or_one
[n0
] * t0
);
764 t1
= (__vlibm_TBL_sincos_hi
[j1
+((n1
+xsb1
)&3)] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+n1
];
765 t2
= (__vlibm_TBL_sincos_hi
[j2
+((n2
+xsb2
)&3)] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+n2
];
772 j0
= (xsb0
+ 0x4000) & 0xffff8000;
774 j2
= (xsb2
+ 0x4000) & 0xffff8000;
788 t0
= z0
* (qq1
+ z0
* qq2
);
789 t1
= z1
* (poly3
[j1
] + z1
* poly4
[j1
]);
790 t2
= z2
* (qq1
+ z2
* qq2
);
791 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
792 t1
= z1
* (poly1
[j1
] + z1
* (poly2
[j1
] + t1
));
793 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
794 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
795 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
796 xsb0
= (xsb0
>> 30) & 2;
797 xsb2
= (xsb2
>> 30) & 2;
798 n0
^= (xsb0
& ~(n0
<< 1));
799 n2
^= (xsb2
& ~(n2
<< 1));
802 a0
= __vlibm_TBL_sincos_hi
[j0
+n0
];
803 a2
= __vlibm_TBL_sincos_hi
[j2
+n2
];
804 t0
= (__vlibm_TBL_sincos_hi
[j0
+((n0
+xsb0
)&3)] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+n0
];
805 t1
= x1_or_one
[n1
] + (y1_or_zero
[n1
] + x1_or_one
[n1
] * t1
);
806 t2
= (__vlibm_TBL_sincos_hi
[j2
+((n2
+xsb2
)&3)] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+n2
];
815 j2
= (xsb2
+ 0x4000) & 0xffff8000;
830 t0
= z0
* (poly3
[j0
] + z0
* poly4
[j0
]);
831 t1
= z1
* (poly3
[j1
] + z1
* poly4
[j1
]);
832 t2
= z2
* (qq1
+ z2
* qq2
);
833 t0
= z0
* (poly1
[j0
] + z0
* (poly2
[j0
] + t0
));
834 t1
= z1
* (poly1
[j1
] + z1
* (poly2
[j1
] + t1
));
835 w2
= x2
* (one
+ z2
* (pp1
+ z2
* pp2
));
836 j2
= (((j2
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
837 xsb2
= (xsb2
>> 30) & 2;
838 n2
^= (xsb2
& ~(n2
<< 1));
840 a2
= __vlibm_TBL_sincos_hi
[j2
+n2
];
841 t0
= x0_or_one
[n0
] + (y0_or_zero
[n0
] + x0_or_one
[n0
] * t0
);
842 t1
= x1_or_one
[n1
] + (y1_or_zero
[n1
] + x1_or_one
[n1
] * t1
);
843 t2
= (__vlibm_TBL_sincos_hi
[j2
+((n2
+xsb2
)&3)] * w2
+ a2
* t2
) + __vlibm_TBL_sincos_lo
[j2
+n2
];
850 j0
= (xsb0
+ 0x4000) & 0xffff8000;
851 j1
= (xsb1
+ 0x4000) & 0xffff8000;
866 t0
= z0
* (qq1
+ z0
* qq2
);
867 t1
= z1
* (qq1
+ z1
* qq2
);
868 t2
= z2
* (poly3
[j2
] + z2
* poly4
[j2
]);
869 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
870 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
871 t2
= z2
* (poly1
[j2
] + z2
* (poly2
[j2
] + t2
));
872 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
873 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
874 xsb0
= (xsb0
>> 30) & 2;
875 xsb1
= (xsb1
>> 30) & 2;
876 n0
^= (xsb0
& ~(n0
<< 1));
877 n1
^= (xsb1
& ~(n1
<< 1));
880 a0
= __vlibm_TBL_sincos_hi
[j0
+n0
];
881 a1
= __vlibm_TBL_sincos_hi
[j1
+n1
];
882 t0
= (__vlibm_TBL_sincos_hi
[j0
+((n0
+xsb0
)&3)] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+n0
];
883 t1
= (__vlibm_TBL_sincos_hi
[j1
+((n1
+xsb1
)&3)] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+n1
];
884 t2
= x2_or_one
[n2
] + (y2_or_zero
[n2
] + x2_or_one
[n2
] * t2
);
892 j1
= (xsb1
+ 0x4000) & 0xffff8000;
908 t0
= z0
* (poly3
[j0
] + z0
* poly4
[j0
]);
909 t1
= z1
* (qq1
+ z1
* qq2
);
910 t2
= z2
* (poly3
[j2
] + z2
* poly4
[j2
]);
911 t0
= z0
* (poly1
[j0
] + z0
* (poly2
[j0
] + t0
));
912 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
913 t2
= z2
* (poly1
[j2
] + z2
* (poly2
[j2
] + t2
));
914 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
915 xsb1
= (xsb1
>> 30) & 2;
916 n1
^= (xsb1
& ~(n1
<< 1));
918 a1
= __vlibm_TBL_sincos_hi
[j1
+n1
];
919 t0
= x0_or_one
[n0
] + (y0_or_zero
[n0
] + x0_or_one
[n0
] * t0
);
920 t1
= (__vlibm_TBL_sincos_hi
[j1
+((n1
+xsb1
)&3)] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+n1
];
921 t2
= x2_or_one
[n2
] + (y2_or_zero
[n2
] + x2_or_one
[n2
] * t2
);
928 j0
= (xsb0
+ 0x4000) & 0xffff8000;
945 t0
= z0
* (qq1
+ z0
* qq2
);
946 t1
= z1
* (poly3
[j1
] + z1
* poly4
[j1
]);
947 t2
= z2
* (poly3
[j2
] + z2
* poly4
[j2
]);
948 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
949 t1
= z1
* (poly1
[j1
] + z1
* (poly2
[j1
] + t1
));
950 t2
= z2
* (poly1
[j2
] + z2
* (poly2
[j2
] + t2
));
951 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
952 xsb0
= (xsb0
>> 30) & 2;
953 n0
^= (xsb0
& ~(n0
<< 1));
955 a0
= __vlibm_TBL_sincos_hi
[j0
+n0
];
956 t0
= (__vlibm_TBL_sincos_hi
[j0
+((n0
+xsb0
)&3)] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+n0
];
957 t1
= x1_or_one
[n1
] + (y1_or_zero
[n1
] + x1_or_one
[n1
] * t1
);
958 t2
= x2_or_one
[n2
] + (y2_or_zero
[n2
] + x2_or_one
[n2
] * t2
);
983 t0
= z0
* (poly3
[j0
] + z0
* poly4
[j0
]);
984 t1
= z1
* (poly3
[j1
] + z1
* poly4
[j1
]);
985 t2
= z2
* (poly3
[j2
] + z2
* poly4
[j2
]);
986 t0
= z0
* (poly1
[j0
] + z0
* (poly2
[j0
] + t0
));
987 t1
= z1
* (poly1
[j1
] + z1
* (poly2
[j1
] + t1
));
988 t2
= z2
* (poly1
[j2
] + z2
* (poly2
[j2
] + t2
));
989 t0
= x0_or_one
[n0
] + (y0_or_zero
[n0
] + x0_or_one
[n0
] * t0
);
990 t1
= x1_or_one
[n1
] + (y1_or_zero
[n1
] + x1_or_one
[n1
] * t1
);
991 t2
= x2_or_one
[n2
] + (y2_or_zero
[n2
] + x2_or_one
[n2
] * t2
);
1005 double fn0
, fn1
, a0
, a1
, w0
, w1
, y0
, y1
;
1006 double t0
, t1
, z0
, z1
;
1012 n1
= (int) (x1
* invpio2
+ half
[xsb1
]);
1015 a1
= x1
- fn1
* pio2_1
;
1018 y1
= (a1
- x1
) - w1
;
1020 w1
= fn1
* pio2_3
- y1
;
1022 y1
= (a1
- x1
) - w1
;
1024 w1
= fn1
* pio2_3t
- y1
;
1026 y1
= (a1
- x1
) - w1
;
1028 if ((xsb1
& ~0x80000000) < thresh
[n1
&1])
1034 y1_or_zero
[2] = -y1
;
1036 t1
= z1
* (poly3
[j1
] + z1
* poly4
[j1
]);
1037 t1
= z1
* (poly1
[j1
] + z1
* (poly2
[j1
] + t1
));
1038 t1
= x1_or_one
[n1
] + (y1_or_zero
[n1
] + x1_or_one
[n1
] * t1
);
1043 j1
= (xsb1
+ 0x4000) & 0xffff8000;
1046 x1
= (x1
- t1
) + y1
;
1048 t1
= z1
* (qq1
+ z1
* qq2
);
1049 w1
= x1
* (one
+ z1
* (pp1
+ z1
* pp2
));
1050 j1
= (((j1
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
1051 xsb1
= (xsb1
>> 30) & 2;
1052 n1
^= (xsb1
& ~(n1
<< 1));
1054 a1
= __vlibm_TBL_sincos_hi
[j1
+n1
];
1055 t1
= (__vlibm_TBL_sincos_hi
[j1
+((n1
+xsb1
)&3)] * w1
+ a1
* t1
) + __vlibm_TBL_sincos_lo
[j1
+n1
];
1059 n0
= (int) (x0
* invpio2
+ half
[xsb0
]);
1062 a0
= x0
- fn0
* pio2_1
;
1065 y0
= (a0
- x0
) - w0
;
1067 w0
= fn0
* pio2_3
- y0
;
1069 y0
= (a0
- x0
) - w0
;
1071 w0
= fn0
* pio2_3t
- y0
;
1073 y0
= (a0
- x0
) - w0
;
1075 if ((xsb0
& ~0x80000000) < thresh
[n0
&1])
1081 y0_or_zero
[2] = -y0
;
1083 t0
= z0
* (poly3
[j0
] + z0
* poly4
[j0
]);
1084 t0
= z0
* (poly1
[j0
] + z0
* (poly2
[j0
] + t0
));
1085 t0
= x0_or_one
[n0
] + (y0_or_zero
[n0
] + x0_or_one
[n0
] * t0
);
1090 j0
= (xsb0
+ 0x4000) & 0xffff8000;
1093 x0
= (x0
- t0
) + y0
;
1095 t0
= z0
* (qq1
+ z0
* qq2
);
1096 w0
= x0
* (one
+ z0
* (pp1
+ z0
* pp2
));
1097 j0
= (((j0
& ~0x80000000) - 0x3fc40000) >> 13) & ~0x3;
1098 xsb0
= (xsb0
>> 30) & 2;
1099 n0
^= (xsb0
& ~(n0
<< 1));
1101 a0
= __vlibm_TBL_sincos_hi
[j0
+n0
];
1102 t0
= (__vlibm_TBL_sincos_hi
[j0
+((n0
+xsb0
)&3)] * w0
+ a0
* t0
) + __vlibm_TBL_sincos_lo
[j0
+n0
];
1108 __vlibm_vsin_big(nsave
, xsave
, sxsave
, ysave
, sysave
, 0x413921fb);