32 #ifdef POK_NEEDS_LIBMATH
36 #include "math_private.h"
38 static const float atanhi[] = {
45 static const float atanlo[] = {
52 static const float aT[] = {
81 if(hx>0)
return atanhi[3]+atanlo[3];
82 else return -atanhi[3]-atanlo[3];
83 }
if (ix < 0x3ee00000) {
84 if (ix < 0x31000000) {
85 if(huge+x>one)
return x;
90 if (ix < 0x3f980000) {
91 if (ix < 0x3f300000) {
92 id = 0; x = ((float)2.0*x-one)/((float)2.0+x);
94 id = 1; x = (x-one)/(x+one);
97 if (ix < 0x401c0000) {
98 id = 2; x = (x-(float)1.5)/(one+(float)1.5*x);
100 id = 3; x = -(float)1.0/x;
107 s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10])))));
108 s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9]))));
109 if (
id<0)
return x - x*(s1+s2);
111 z = atanhi[id] - ((x*(s1+s2) - atanlo[
id]) - x);