32 #ifdef POK_NEEDS_LIBMATH
34 #include "math_private.h"
39 pi_o_4 = 7.8539818525e-01,
40 pi_o_2 = 1.5707963705e+00,
41 pi = 3.1415925026e+00,
42 pi_lo = 1.5099578832e-07;
45 __ieee754_atan2f(
float y,
float x)
48 int32_t k,m,hx,hy,ix,iy;
57 if(hx==0x3f800000)
return atanf(y);
58 m = ((hy>>31)&1)|((hx>>30)&2);
65 case 2:
return pi+tiny;
66 case 3:
return -pi-tiny;
70 if(ix==0)
return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
76 case 0:
return pi_o_4+tiny;
77 case 1:
return -pi_o_4-tiny;
78 case 2:
return (
float)3.0*pi_o_4+tiny;
79 case 3:
return (
float)-3.0*pi_o_4-tiny;
84 case 1:
return -zero ;
85 case 2:
return pi+tiny ;
86 case 3:
return -pi-tiny ;
91 if(iy==0x7f800000)
return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
95 if(k > 60) z=pi_o_2+(float)0.5*pi_lo;
96 else if(hx<0&&k<-60) z=0.0;
97 else z=atanf(fabsf(y/x));
102 GET_FLOAT_WORD(zh,z);
103 SET_FLOAT_WORD(z,zh ^ 0x80000000);
106 case 2:
return pi-(z-pi_lo);