Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/jnl.c
          +++ new/usr/src/lib/libm/common/LD/jnl.c
↓ open down ↓ 50 lines elided ↑ open up ↑
  51   51   *      compared with the actual value to correct the
  52   52   *      supposed value of j(n,x).
  53   53   *
  54   54   *      yn(n,x) is similar in all respects, except
  55   55   *      that forward recursion is used for all
  56   56   *      values of n>1.
  57   57   *      
  58   58   */
  59   59  
  60   60  #include "libm.h"
       61 +#include "longdouble.h"
  61   62  #include <float.h>      /* LDBL_MAX */
  62   63  
  63   64  #define GENERIC long double
  64   65  
  65   66  static const GENERIC
  66   67  invsqrtpi= 5.641895835477562869480794515607725858441e-0001L,
  67   68  two  = 2.0L,
  68   69  zero = 0.0L,
  69   70  one  = 1.0L;
  70   71  
  71   72  GENERIC
  72   73  jnl(n,x) int n; GENERIC x;{
  73   74          int i, sgn;
  74      -        GENERIC a, b, temp, z, w;
       75 +        GENERIC a, b, temp = 0, z, w;
  75   76  
  76   77      /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
  77   78       * Thus, J(-n,x) = J(n,-x)
  78   79       */
  79   80          if(n<0){                
  80   81                  n = -n;
  81   82                  x = -x;
  82   83          }
  83   84          if(n==0) return(j0l(x));
  84   85          if(n==1) return(j1l(x));
↓ open down ↓ 119 lines elided ↑ open up ↑
 204  205                  b = (t*j0l(x)/b);
 205  206              }
 206  207          }
 207  208          if(sgn==1) return -b; else return b;
 208  209  }
 209  210  
 210  211  GENERIC ynl(n,x) 
 211  212  int n; GENERIC x;{
 212  213          int i;
 213  214          int sign;
 214      -        GENERIC a, b, temp;
      215 +        GENERIC a, b, temp = 0;
 215  216  
 216      -        if(x!=x) return x+x;
 217      -        if (x <= zero) 
      217 +        if(x!=x)
      218 +                return x+x;
      219 +        if (x <= zero) {
 218  220                  if(x==zero) 
 219  221                          return -one/zero;
 220  222                  else 
 221  223                          return zero/zero;
      224 +        }
 222  225          sign = 1;
 223  226          if(n<0){
 224  227                  n = -n;
 225  228                  if((n&1) == 1) sign = -1;
 226  229          }
 227  230          if(n==0) return(y0l(x));
 228  231          if(n==1) return(sign*y1l(x));
 229  232          if(!finitel(x)) return zero;
 230  233  
 231  234          if(x>1.0e91L) { /* x >> n**2 
↓ open down ↓ 36 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX