25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER START
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * The contents of this file are subject to the terms of the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Common Development and Distribution License (the "License").
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You may not use this file except in compliance with the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * See the License for the specific language governing permissions
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * and limitations under the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER END
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Use is subject to license terms.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#define restrict _Restrict
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#define restrict
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern const double __vlibm_TBL_sincos_hi[], __vlibm_TBL_sincos_lo[];
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern int __vlibm_rem_pio2m(double *, double *, int, int, int);
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisstatic const double
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis pp1 = -1.666666666605760465276263943134982554676e-0001,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis pp2 = 8.333261209690963126718376566146180944442e-0003,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis p1 = -1.666666666666629669805215138920301589656e-0001,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis p2 = 8.333333332390951295683993455280336376663e-0003,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis p3 = -1.984126237997976692791551778230098403960e-0004,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis p4 = 2.753403624854277237649987622848330351110e-0006,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis qq1 = -4.999999999977710986407023955908711557870e-0001,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis qq2 = 4.166654863857219350645055881018842089580e-0002,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis q1 = -4.999999999999931701464060878888294524481e-0001,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis q2 = 4.166666666394861917535640593963708222319e-0002,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis q3 = -1.388888552656142867832756687736851681462e-0003,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis q4 = 2.478519423681460796618128289454530524759e-0005;
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis__vlibm_vcos_big(int n, double * restrict x, int stridex, double * restrict y,
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis nx = __vlibm_rem_pio2m(tt, ty, e0, nx, 2);
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis nx = (nx + 1) & 3; /* Add 1 to turn sin into cos */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis /* now nx and ty[*] are the quadrant and reduced arg */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis t = z * (q1 + z * (q2 + z * (q3 + z * q4)));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis t = __vlibm_TBL_sincos_lo[j+1] - (__vlibm_TBL_sincos_hi[j] * w - a * t);
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis t = z * (p1 + z * (p2 + z * (p3 + z * p4)));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis t = (__vlibm_TBL_sincos_hi[j+1] * w + a * t) + __vlibm_TBL_sincos_lo[j];