k_sinf.c revision 152951
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 152951 2005-11-30 11:51:17Z 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{ 39152951Sbde double r, s, w, z; 40151620Sbde 41152951Sbde /* Try to optimize for parallel evaluation as in k_tanf.c. */ 42152951Sbde z = x*x; 43152951Sbde w = z*z; 44152951Sbde r = S3+z*S4; 45152951Sbde s = z*x; 46152951Sbde return (x + s*(S1+z*S2)) + s*w*r; 472116Sjkh} 48