[BACK]Return to s_atan.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libm / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libm/src/s_atan.c between version 1.1.1.1 and 1.6

version 1.1.1.1, 1994/02/11 17:52:19 version 1.6, 1994/08/18 23:06:23
Line 1 
Line 1 
   
 /* @(#)s_atan.c 5.1 93/09/24 */  /* @(#)s_atan.c 5.1 93/09/24 */
 /*  /*
  * ====================================================   * ====================================================
Line 9 
Line 8 
  * software is freely granted, provided that this notice   * software is freely granted, provided that this notice
  * is preserved.   * is preserved.
  * ====================================================   * ====================================================
  *  
  */   */
   
   #ifndef lint
   static char rcsid[] = "$Id$";
   #endif
   
 /* atan(x)  /* atan(x)
  * Method   * Method
  *   1. Reduce x to positive by atan(x) = -atan(-x).   *   1. Reduce x to positive by atan(x) = -atan(-x).
Line 32 
Line 34 
  * to produce the hexadecimal values shown.   * to produce the hexadecimal values shown.
  */   */
   
 #include "fdlibm.h"  #include "math.h"
   #include "math_private.h"
   
 #ifdef __STDC__  #ifdef __STDC__
 static const double atanhi[] = {  static const double atanhi[] = {
Line 90  huge   = 1.0e300;
Line 93  huge   = 1.0e300;
 #endif  #endif
 {  {
         double w,s1,s2,z;          double w,s1,s2,z;
         int n0,ix,hx,id;          int32_t ix,hx,id;
   
         n0 = ((*(int*)&one)>>29)^1;          GET_HIGH_WORD(hx,x);
         hx = *(n0+(int*)&x);  
         ix = hx&0x7fffffff;          ix = hx&0x7fffffff;
         if(ix>=0x44100000) {    /* if |x| >= 2^66 */          if(ix>=0x44100000) {    /* if |x| >= 2^66 */
               u_int32_t low;
               GET_LOW_WORD(low,x);
             if(ix>0x7ff00000||              if(ix>0x7ff00000||
                 (ix==0x7ff00000&&(*(1-n0+(int*)&x)!=0)))                  (ix==0x7ff00000&&(low!=0)))
                 return x+x;             /* NaN */                  return x+x;             /* NaN */
             if(hx>0) return  atanhi[3]+atanlo[3];              if(hx>0) return  atanhi[3]+atanlo[3];
             else     return -atanhi[3]-atanlo[3];              else     return -atanhi[3]-atanlo[3];

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.6

CVSweb <webmaster@jp.NetBSD.org>