Commit fdc6db4b authored by Raymond Toy's avatar Raymond Toy
Browse files

Use fdlibm_atan instead of atan.

 * fdlibm.h:
   * Declare fdlibm_atan
 * e_atan2.c:
   * Use fdlibm_atan instead of atan.
parent 797b0081
......@@ -75,7 +75,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
if(((ix|((lx|-lx)>>31))>0x7ff00000)||
((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */
return x+y;
if((hx-0x3ff00000|lx)==0) return atan(y); /* x=1.0 */
if((hx-0x3ff00000|lx)==0) return fdlibm_atan(y); /* x=1.0 */
m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */
/* when y = 0 */
......@@ -115,7 +115,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
k = (iy-ix)>>20;
if(k > 60) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**60 */
else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */
else z=atan(fabs(y/x)); /* safe to do y/x */
else z=fdlibm_atan(fabs(y/x)); /* safe to do y/x */
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1:
......
......@@ -53,6 +53,7 @@ extern double fdlibm_cos(double x);
extern double fdlibm_tan(double x);
extern double fdlibm_expm1(double x);
extern double fdlibm_log1p(double x);
extern double fdlibm_atan(double x);
extern double __ieee754_exp(double x);
extern double __ieee754_log(double x);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment