Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>


  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  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]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 /*
  26  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.
  28  */
  29 
  30 #pragma weak sincospil = __sincospil
  31 
  32 /*
  33  * void sincospil(long double x, long double *s, long double *c)
  34  * *s = sinl(pi*x); *c = cosl(pi*x);
  35  *
  36  * Algorithm, 10/17/2002, K.C. Ng
  37  * ------------------------------
  38  * Let y = |4x|, z = floor(y), and n = (int)(z mod 8.0) (displayed in binary).
  39  *      1. If y == z, then x is a multiple of pi/4. Return the following values:
  40  *             ---------------------------------------------------
  41  *               n  x mod 2    sin(x*pi)    cos(x*pi)   tan(x*pi)
  42  *             ---------------------------------------------------
  43  *              000  0.00       +0 ___       +1 ___      +0
  44  *              001  0.25       +\/0.5       +\/0.5      +1
  45  *              010  0.50       +1 ___       +0 ___      +inf
  46  *              011  0.75       +\/0.5       -\/0.5      -1
  47  *              100  1.00       -0 ___       -1 ___      +0
  48  *              101  1.25       -\/0.5       -\/0.5      +1
  49  *              110  1.50       -1 ___       -0 ___      +inf
  50  *              111  1.75       -\/0.5       +\/0.5      -1
  51  *             ---------------------------------------------------




  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  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]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 /*
  26  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27  * Use is subject to license terms.
  28  */
  29 


  30 /*
  31  * void sincospil(long double x, long double *s, long double *c)
  32  * *s = sinl(pi*x); *c = cosl(pi*x);
  33  *
  34  * Algorithm, 10/17/2002, K.C. Ng
  35  * ------------------------------
  36  * Let y = |4x|, z = floor(y), and n = (int)(z mod 8.0) (displayed in binary).
  37  *      1. If y == z, then x is a multiple of pi/4. Return the following values:
  38  *             ---------------------------------------------------
  39  *               n  x mod 2    sin(x*pi)    cos(x*pi)   tan(x*pi)
  40  *             ---------------------------------------------------
  41  *              000  0.00       +0 ___       +1 ___      +0
  42  *              001  0.25       +\/0.5       +\/0.5      +1
  43  *              010  0.50       +1 ___       +0 ___      +inf
  44  *              011  0.75       +\/0.5       -\/0.5      -1
  45  *              100  1.00       -0 ___       -1 ___      +0
  46  *              101  1.25       -\/0.5       -\/0.5      +1
  47  *              110  1.50       -1 ___       -0 ___      +inf
  48  *              111  1.75       -\/0.5       +\/0.5      -1
  49  *             ---------------------------------------------------