k_sinf.c revision 152869
12116Sjkh/* k_sinf.c -- float version of k_sin.c
22116Sjkh * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3151796Sbde * Optimized by Bruce D. Evans.
42116Sjkh */
52116Sjkh
62116Sjkh/*
72116Sjkh * ====================================================
82116Sjkh * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
92116Sjkh *
102116Sjkh * Developed at SunPro, a Sun Microsystems, Inc. business.
112116Sjkh * Permission to use, copy, modify, and distribute this
128870Srgrimes * software is freely granted, provided that this notice
132116Sjkh * is preserved.
142116Sjkh * ====================================================
152116Sjkh */
162116Sjkh
17152869Sbde#ifndef INLINE_KERNEL_SINDF
182116Sjkh#ifndef lint
1950476Speterstatic char rcsid[] = "$FreeBSD: head/lib/msun/src/k_sinf.c 152869 2005-11-28 04:58:57Z bde $";
202116Sjkh#endif
21152647Sbde#endif
222116Sjkh
232116Sjkh#include "math.h"
242116Sjkh#include "math_private.h"
252116Sjkh
26152869Sbde/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */
27152869Sbdestatic const double
28152869SbdeS1 = -0x15555554cbac77.0p-55,	/* -0.166666666416265235595 */
29152869SbdeS2 =  0x111110896efbb2.0p-59,	/*  0.0083333293858894631756 */
30152869SbdeS3 = -0x1a00f9e2cae774.0p-65,	/* -0.000198393348360966317347 */
31152869SbdeS4 =  0x16cd878c3b46a7.0p-71;	/*  0.0000027183114939898219064 */
322116Sjkh
33152869Sbde#ifdef INLINE_KERNEL_SINDF
34152647Sbdeextern inline
35152647Sbde#endif
3697413Salfredfloat
37152869Sbde__kernel_sindf(double x)
382116Sjkh{
39152869Sbde	double z,r,v;
40151620Sbde
412116Sjkh	z	=  x*x;
422116Sjkh	v	=  z*x;
43151796Sbde	r	=  S2+z*(S3+z*S4);
44152869Sbde	return x+v*(S1+z*r);
452116Sjkh}
46