#ifdef __RESTRICT
#define restrict _Restrict
#else
#define restrict
#endif
void
__vatanf(int n, float * restrict x, int stridex, float * restrict y, int stridey)
{
extern const double __vlibm_TBL_atan1[];
double conup0, conup1, conup2;
float dummy, ansf = 0.0;
float f0, f1, f2;
float ans0, ans1, ans2;
float poly0, poly1, poly2;
float sign0, sign1, sign2;
int intf, intz, argcount;
int index0, index1, index2;
float z,*yaddr0,*yaddr1,*yaddr2;
int *pz = (int *) &z;
#ifdef UNROLL4
double conup3;
int index3;
float f3, ans3, poly3, sign3, *yaddr3;
#endif
static const float p1 = -0.33329644f ;
static const float pone = 1.0f;
if (n <= 0) return;
do
{
LOOP0:
intf = *(int *) x;
f0 = *x;
sign0 = pone;
if (intf < 0) {
intf = intf & ~0x80000000;
f0 = -f0;
sign0 = -sign0;
}
if ((intf > 0x5B000000) || (intf < 0x31800000))
{
if (intf > 0x7f800000)
{
ansf = f0- f0;
}
else if (intf < 0x31800000)
{
dummy = 1.0e37 + f0;
dummy = dummy;
ansf = f0;
}
else if (intf > 0x5B000000)
{
index0= 2;
ansf = __vlibm_TBL_atan1[index0];
}
*y = sign0*ansf;
x += stridex;
y += stridey;
argcount = 0;
if (--n <=0) break;
goto LOOP0;
}
if (intf > 0x42800000)
{
f0 = -pone/f0;
index0 = 2;
}
else if (intf >= 0x3C800000)
{
intz = (intf + 0x00040000) & 0x7ff80000;
pz[0] = intz;
f0 = (f0 - z)/(pone + f0*z);
index0 = (intz - 0x3C800000) >> 18;
index0 = index0+ 4;
}
else
{
index0 = 0;
}
yaddr0 = y;
x += stridex;
y += stridey;
argcount = 1;
if (--n <=0)
{
goto UNROLL;
}
LOOP1:
intf = *(int *) x;
f1 = *x;
sign1 = pone;
if (intf < 0) {
intf = intf & ~0x80000000;
f1 = -f1;
sign1 = -sign1;
}
if ((intf > 0x5B000000) || (intf < 0x31800000))
{
if (intf > 0x7f800000)
{
ansf = f1 - f1;
}
else if (intf < 0x31800000)
{
dummy = 1.0e37 + f1;
dummy = dummy;
ansf = f1;
}
else if (intf > 0x5B000000)
{
index1 = 2;
ansf = __vlibm_TBL_atan1[index1] ;
}
*y = sign1 * ansf;
x += stridex;
y += stridey;
argcount = 1;
if (--n <=0)
{
goto UNROLL;
}
goto LOOP1;
}
if (intf > 0x42800000)
{
f1 = -pone/f1;
index1 = 2;
}
else if (intf >= 0x3C800000)
{
intz = (intf + 0x00040000) & 0x7ff80000;
pz[0] = intz;
f1 = (f1 - z)/(pone + f1*z);
index1 = (intz - 0x3C800000) >> 18;
index1 = index1 + 4;
}
else
{
index1 = 0;
}
yaddr1 = y;
x += stridex;
y += stridey;
argcount = 2;
if (--n <=0)
{
goto UNROLL;
}
LOOP2:
intf = *(int *) x;
f2 = *x;
sign2 = pone;
if (intf < 0) {
intf = intf & ~0x80000000;
f2 = -f2;
sign2 = -sign2;
}
if ((intf > 0x5B000000) || (intf < 0x31800000))
{
if (intf > 0x7f800000)
{
ansf = f2 - f2;
}
else if (intf < 0x31800000)
{
dummy = 1.0e37 + f2;
dummy = dummy;
ansf = f2;
}
else if (intf > 0x5B000000)
{
index2 = 2;
ansf = __vlibm_TBL_atan1[index2] ;
}
*y = sign2 * ansf;
x += stridex;
y += stridey;
argcount = 2;
if (--n <=0)
{
goto UNROLL;
}
goto LOOP2;
}
if (intf > 0x42800000)
{
f2 = -pone/f2;
index2 = 2;
}
else if (intf >= 0x3C800000)
{
intz = (intf + 0x00040000) & 0x7ff80000;
pz[0] = intz;
f2 = (f2 - z)/(pone + f2*z);
index2 = (intz - 0x3C800000) >> 18;
index2 = index2 + 4;
}
else
{
index2 = 0;
}
yaddr2 = y;
x += stridex;
y += stridey;
argcount = 3;
if (--n <=0)
{
goto UNROLL;
}
#ifdef UNROLL4
LOOP3:
intf = *(int *) x;
f3 = *x;
sign3 = pone;
if (intf < 0) {
intf = intf & ~0x80000000;
f3 = -f3;
sign3 = -sign3;
}
if ((intf > 0x5B000000) || (intf < 0x31800000))
{
if (intf > 0x7f800000)
{
ansf = f3 - f3;
}
else if (intf < 0x31800000)
{
dummy = 1.0e37 + f3;
dummy = dummy;
ansf = f3;
}
else if (intf > 0x5B000000)
{
index3 = 2;
ansf = __vlibm_TBL_atan1[index3] ;
}
*y = sign3 * ansf;
x += stridex;
y += stridey;
argcount = 3;
if (--n <=0)
{
goto UNROLL;
}
goto LOOP3;
}
if (intf > 0x42800000)
{
n3 = -pone;
d3 = f3;
f3 = n3/d3;
index3 = 2;
}
else if (intf >= 0x3C800000)
{
intz = (intf + 0x00040000) & 0x7ff80000;
pz[0] = intz;
n3 = (f3 - z);
d3 = (pone + f3*z);
f3 = n3/d3;
index3 = (intz - 0x3C800000) >> 18;
index3 = index3 + 4;
}
else
{
n3 = f3;
d3 = pone;
index3 = 0;
}
yaddr3 = y;
x += stridex;
y += stridey;
argcount = 4;
if (--n <=0)
{
goto UNROLL;
}
#endif
UNROLL:
#ifdef UNROLL4
if (argcount == 4)
{
conup0 = __vlibm_TBL_atan1[index0];
conup1 = __vlibm_TBL_atan1[index1];
conup2 = __vlibm_TBL_atan1[index2];
conup3 = __vlibm_TBL_atan1[index3];
poly0 = p1*f0*f0*f0 + f0;
ans0 = sign0 * (float)(conup0 + poly0);
poly1 = p1*f1*f1*f1 + f1;
ans1 = sign1 * (float)(conup1 + poly1);
poly2 = p1*f2*f2*f2 + f2;
ans2 = sign2 * (float)(conup2 + poly2);
poly3 = p1*f3*f3*f3 + f3;
ans3 = sign3 * (float)(conup3 + poly3);
*yaddr0 = ans0;
*yaddr1 = ans1;
*yaddr2 = ans2;
*yaddr3 = ans3;
}
else
#endif
if (argcount == 3)
{
conup0 = __vlibm_TBL_atan1[index0];
conup1 = __vlibm_TBL_atan1[index1];
conup2 = __vlibm_TBL_atan1[index2];
poly0 = p1*f0*f0*f0 + f0;
poly1 = p1*f1*f1*f1 + f1;
poly2 = p1*f2*f2*f2 + f2;
ans0 = sign0 * (float)(conup0 + poly0);
ans1 = sign1 * (float)(conup1 + poly1);
ans2 = sign2 * (float)(conup2 + poly2);
*yaddr0 = ans0;
*yaddr1 = ans1;
*yaddr2 = ans2;
}
else
if (argcount == 2)
{
conup0 = __vlibm_TBL_atan1[index0];
conup1 = __vlibm_TBL_atan1[index1];
poly0 = p1*f0*f0*f0 + f0;
poly1 = p1*f1*f1*f1 + f1;
ans0 = sign0 * (float)(conup0 + poly0);
ans1 = sign1 * (float)(conup1 + poly1);
*yaddr0 = ans0;
*yaddr1 = ans1;
}
else
if (argcount == 1)
{
conup0 = __vlibm_TBL_atan1[index0];
poly0 = p1*f0*f0*f0 + f0;
ans0 = sign0 * (float)(conup0 + poly0);
*yaddr0 = ans0;
}
} while (n > 0);
}