/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/isa_defs.h>
#ifdef _LITTLE_ENDIAN
#define LO(x) *(unsigned*)x
#else
#define HI(x) *(int*)x
#endif
#ifdef __RESTRICT
#define restrict _Restrict
#else
#define restrict
#endif
extern const double __vlibm_TBL_sincos_hi[], __vlibm_TBL_sincos_lo[];
extern int __vlibm_rem_pio2m(double *, double *, int, int, int);
static const double
void
{
{
tx = *x;
hx &= ~0x80000000;
continue;
{
nx = 2;
nx = 3;
}
else
{
nx = 1;
}
if (xsb)
{
}
/* now nx and ty[*] are the quadrant and reduced arg */
xsb = 0;
if (hx & 0x80000000)
{
hx &= ~0x80000000;
xsb = 1;
}
if (hx < 0x3fc40000)
{
c = one + t;
}
else {
HI(&t) = j;
LO(&t) = 0;
j = ((j - 0x3fc40000) >> 13) & ~3;
c = __vlibm_TBL_sincos_hi[j+1];
c += tc;
s = __vlibm_TBL_sincos_hi[j];
s += ts;
}
if (xsb) {
s = -s;
}
switch (nx & 3) {
case 0:
*ss = s;
*cc = c;
break;
case 1:
*ss = c;
*cc = -s;
break;
case 2:
*ss = -s;
*cc = -c;
break;
case 3:
*ss = -c;
*cc = s;
break;
}
}
}