version 1.5, 1997/10/09 11:28:42 |
version 1.6, 1999/07/02 15:37:38 |
|
|
* |
* |
* Developed at SunPro, a Sun Microsystems, Inc. business. |
* Developed at SunPro, a Sun Microsystems, Inc. business. |
* Permission to use, copy, modify, and distribute this |
* Permission to use, copy, modify, and distribute this |
* software is freely granted, provided that this notice |
* software is freely granted, provided that this notice |
* is preserved. |
* is preserved. |
* ==================================================== |
* ==================================================== |
*/ |
*/ |
Line 22 __RCSID("$NetBSD$"); |
|
Line 22 __RCSID("$NetBSD$"); |
|
#include "math_private.h" |
#include "math_private.h" |
|
|
#ifdef __STDC__ |
#ifdef __STDC__ |
static const float |
static const float |
#else |
#else |
static float |
static float |
#endif |
#endif |
tiny = 1.0e-30, |
tiny = 1.0e-30, |
zero = 0.0, |
zero = 0.0, |
Line 39 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
Line 39 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
float __ieee754_atan2f(y,x) |
float __ieee754_atan2f(y,x) |
float y,x; |
float y,x; |
#endif |
#endif |
{ |
{ |
float z; |
float z; |
int32_t k,m,hx,hy,ix,iy; |
int32_t k,m,hx,hy,ix,iy; |
|
|
Line 56 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
Line 56 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
/* when y = 0 */ |
/* when y = 0 */ |
if(iy==0) { |
if(iy==0) { |
switch(m) { |
switch(m) { |
case 0: |
case 0: |
case 1: return y; /* atan(+-0,+anything)=+-0 */ |
case 1: return y; /* atan(+-0,+anything)=+-0 */ |
case 2: return pi+tiny;/* atan(+0,-anything) = pi */ |
case 2: return pi+tiny;/* atan(+0,-anything) = pi */ |
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ |
case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ |
Line 64 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
Line 64 pi_lo = 1.5099578832e-07; /* 0x3422216 |
|
} |
} |
/* when x = 0 */ |
/* when x = 0 */ |
if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; |
if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; |
|
|
/* when x is INF */ |
/* when x is INF */ |
if(ix==0x7f800000) { |
if(ix==0x7f800000) { |
if(iy==0x7f800000) { |
if(iy==0x7f800000) { |