/* origin: FreeBSD /usr/src/lib/msun/src/k_sinf.c */1/*2* Conversion to float by Ian Lance Taylor, Cygnus Support, [email protected].3* Optimized by Bruce D. Evans.4*/5/*6* ====================================================7* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.8*9* Developed at SunPro, a Sun Microsystems, Inc. business.10* Permission to use, copy, modify, and distribute this11* software is freely granted, provided that this notice12* is preserved.13* ====================================================14*/1516#include "libm.h"1718/* |sin(x)/x - s(x)| < 2**-37.5 (~[-4.89e-12, 4.824e-12]). */19static const double20S1 = -0x1.5555555555555p-3,21S2 = 0x1.1111111111111p-7,22S3 = -0x1.a01a01a01a01ap-13,23S4 = 0x1.71de3a556c734p-19;2425float __sindf(double x)26{27double_t r, s, w, z;2829/* Try to optimize for parallel evaluation as in __tandf.c. */30z = x*x;31if (x > -7.8175831586122513e-03 && x < 7.8175831586122513e-03)32return x * (1 + S1 * z);33w = z*z;34r = S3 + z*S4;35s = z*x;36return (x + s*(S1 + z*S2)) + s*w*r;37}383940