32 #ifdef POK_NEEDS_LIBMATH
34 #include "math_private.h"
37 __ieee754_hypotf(
float x,
float y)
39 float a=x,b=y,t1,t2,yy1,y2,w;
46 if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;}
else {a=x;b=y;}
49 if((ha-hb)>0xf000000) {
return a+b;}
52 if(ha >= 0x7f800000) {
54 if(ha == 0x7f800000) w = a;
55 if(hb == 0x7f800000) w = b;
59 ha -= 0x5d800000; hb -= 0x5d800000; k += 60;
64 if(hb <= 0x007fffff) {
66 SET_FLOAT_WORD(t1,0x3f000000);
81 SET_FLOAT_WORD(t1,ha&0xfffff000);
83 w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1)));
86 SET_FLOAT_WORD(yy1,hb&0xfffff000);
88 SET_FLOAT_WORD(t1,ha+0x00800000);
90 w = __ieee754_sqrtf(t1*yy1-(w*(-w)-(t1*y2+t2*b)));
93 SET_FLOAT_WORD(t1,0x3f800000+(k<<23));