32 #ifdef POK_NEEDS_LIBMATH
34 #include "math_private.h"
37 one = 1.0000000000e+00,
38 pi = 3.1415925026e+00,
39 pio2_hi = 1.5707962513e+00,
40 pio2_lo = 7.5497894159e-08,
41 pS0 = 1.6666667163e-01,
42 pS1 = -3.2556581497e-01,
43 pS2 = 2.0121252537e-01,
44 pS3 = -4.0055535734e-02,
45 pS4 = 7.9153501429e-04,
46 pS5 = 3.4793309169e-05,
47 qS1 = -2.4033949375e+00,
48 qS2 = 2.0209457874e+00,
49 qS3 = -6.8828397989e-01,
50 qS4 = 7.7038154006e-02;
53 __ieee754_acosf(
float x)
55 float z,p,q,r,w,s,c,df;
61 else return pi+(float)2.0*pio2_lo;
62 }
else if(ix>0x3f800000) {
66 if(ix<=0x23000000)
return pio2_hi+pio2_lo;
68 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
69 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
71 return pio2_hi - (x - (pio2_lo-x*r));
73 z = (one+x)*(
float)0.5;
74 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
75 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
76 s = __ieee754_sqrtf(z);
79 return pi - (float)2.0*(s+w);
82 z = (one-x)*(
float)0.5;
83 s = __ieee754_sqrtf(z);
85 GET_FLOAT_WORD(idf,df);
86 SET_FLOAT_WORD(df,idf&0xfffff000);
88 p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
89 q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
92 return (
float)2.0*(df+w);