k_sinf.c revision 151620
12116Sjkh/* k_sinf.c -- float version of k_sin.c
22116Sjkh * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
32116Sjkh */
42116Sjkh
52116Sjkh/*
62116Sjkh * ====================================================
72116Sjkh * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
82116Sjkh *
92116Sjkh * Developed at SunPro, a Sun Microsystems, Inc. business.
102116Sjkh * Permission to use, copy, modify, and distribute this
118870Srgrimes * software is freely granted, provided that this notice
122116Sjkh * is preserved.
132116Sjkh * ====================================================
142116Sjkh */
152116Sjkh
162116Sjkh#ifndef lint
1750476Speterstatic char rcsid[] = "$FreeBSD: head/lib/msun/src/k_sinf.c 151620 2005-10-24 14:08:36Z bde $";
182116Sjkh#endif
192116Sjkh
202116Sjkh#include "math.h"
212116Sjkh#include "math_private.h"
222116Sjkh
238870Srgrimesstatic const float
242116Sjkhhalf =  5.0000000000e-01,/* 0x3f000000 */
252116SjkhS1  = -1.6666667163e-01, /* 0xbe2aaaab */
262116SjkhS2  =  8.3333337680e-03, /* 0x3c088889 */
272116SjkhS3  = -1.9841270114e-04, /* 0xb9500d01 */
282116SjkhS4  =  2.7557314297e-06, /* 0x3638ef1b */
292116SjkhS5  = -2.5050759689e-08, /* 0xb2d72f34 */
302116SjkhS6  =  1.5896910177e-10; /* 0x2f2ec9d3 */
312116Sjkh
3297413Salfredfloat
3397413Salfred__kernel_sinf(float x, float y, int iy)
342116Sjkh{
352116Sjkh	float z,r,v;
36151620Sbde
372116Sjkh	z	=  x*x;
382116Sjkh	v	=  z*x;
392116Sjkh	r	=  S2+z*(S3+z*(S4+z*(S5+z*S6)));
402116Sjkh	if(iy==0) return x+v*(S1+z*r);
412116Sjkh	else      return x-((z*(half*y-v*r)-y)-v*S1);
422116Sjkh}
43