diff -r -b -B -c1 k_and_r\examples\xrlft3.c ..\k_and_r\examples\xrlft3.c *** k_and_r\examples\xrlft3.c Tue Feb 13 19:17:02 1996 --- ..\k_and_r\examples\xrlft3.c Sat Dec 01 18:05:46 2001 *************** *** 40,42 **** long idum=(-3); ! unsigned long err,i,j,k,l,nn1=NX,nn2=NY,nn3=NZ; float fnorm,***data1,***data2,**speq1; --- 41,43 ---- long idum=(-3); ! unsigned long err,i,j,k,nn1=NX,nn2=NY,nn3=NZ; float fnorm,***data1,***data2,**speq1; diff -r -b -B -c1 k_and_r\recipes\bessj0.c ..\k_and_r\recipes\bessj0.c *** k_and_r\recipes\bessj0.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\bessj0.c Sat Dec 01 18:05:02 2001 *************** *** 23,25 **** +y*(-0.6911147651e-5+y*(0.7621095161e-6 ! -y*0.934935152e-7))); ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-z*sin(xx)*ans2); --- 24,26 ---- +y*(-0.6911147651e-5+y*(0.7621095161e-6 ! -y*0.934945152e-7))); ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-z*sin(xx)*ans2); diff -r -b -B -c1 k_and_r\recipes\broydn.c ..\k_and_r\recipes\broydn.c *** k_and_r\recipes\broydn.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\broydn.c Sat Dec 01 18:05:02 2001 *************** *** 108,113 **** for (sum=0.0,j=1;j<=n;j++) sum += qt[i][j]*fvec[j]; ! g[i]=sum; } for (i=n;i>=1;i--) { ! for (sum=0.0,j=1;j<=i;j++) sum += r[j][i]*g[j]; g[i]=sum; --- 109,114 ---- for (sum=0.0,j=1;j<=n;j++) sum += qt[i][j]*fvec[j]; ! p[i] = -sum; } for (i=n;i>=1;i--) { ! for (sum=0.0,j=1;j<=i;j++) sum -= r[j][i]*p[j]; g[i]=sum; *************** *** 119,124 **** fold=f; - for (i=1;i<=n;i++) { - for (sum=0.0,j=1;j<=n;j++) sum += qt[i][j]*fvec[j]; - p[i] = -sum; - } rsolv(r,n,d,p); --- 120,121 ---- diff -r -b -B -c1 k_and_r\recipes\caldat.c ..\k_and_r\recipes\caldat.c *** k_and_r\recipes\caldat.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\caldat.c Sat Dec 01 18:05:02 2001 *************** *** 10,12 **** if (julian >= IGREG) { ! jalpha=(long)(((float) (julian-1867216)-0.25)/36524.25); ja=julian+1+jalpha-(long) (0.25*jalpha); --- 11,13 ---- if (julian >= IGREG) { ! jalpha=(long)(((double) (julian-1867216)-0.25)/36524.25); ja=julian+1+jalpha-(long) (0.25*jalpha); *************** *** 17,19 **** jb=ja+1524; ! jc=(long)(6680.0+((float) (jb-2439870)-122.1)/365.25); jd=(long)(365*jc+(0.25*jc)); --- 18,20 ---- jb=ja+1524; ! jc=(long)(6680.0+((double) (jb-2439870)-122.1)/365.25); jd=(long)(365*jc+(0.25*jc)); *************** *** 26,28 **** if (*iyyy <= 0) --(*iyyy); ! if (julian < 0) iyyy -= 100*(1-julian/36525); } --- 27,29 ---- if (*iyyy <= 0) --(*iyyy); ! if (julian < 0) *iyyy -= 100*(1-julian/36525); } diff -r -b -B -c1 k_and_r\recipes\dftcor.c ..\k_and_r\recipes\dftcor.c *** k_and_r\recipes\dftcor.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\dftcor.c Sat Dec 01 18:05:02 2001 *************** *** 11,13 **** th=w*delta; ! if (a >= b || th < 0.0e0 || th > 3.01416e0) nrerror("bad arguments to dftcor"); if (fabs(th) < 5.0e-2) { --- 12,14 ---- th=w*delta; ! if (a >= b || th < 0.0e0 || th > 3.1416e0) nrerror("bad arguments to dftcor"); if (fabs(th) < 5.0e-2) { diff -r -b -B -c1 k_and_r\recipes\fasper.c ..\k_and_r\recipes\fasper.c *** k_and_r\recipes\fasper.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\fasper.c Sat Dec 01 18:05:02 2001 *************** *** 21,22 **** --- 22,24 ---- avevar(y,n,&ave,&var); + if (var == 0.0) nrerror("zero variance in fasper"); xmin=x[1]; diff -r -b -B -c1 k_and_r\recipes\four1.c ..\k_and_r\recipes\four1.c *** k_and_r\recipes\four1.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\four1.c Sat Dec 01 18:05:02 2001 *************** *** 19,21 **** } ! m=n >> 1; while (m >= 2 && j > m) { --- 20,22 ---- } ! m=nn; while (m >= 2 && j > m) { diff -r -b -B -c1 k_and_r\recipes\gaussj.c ..\k_and_r\recipes\gaussj.c *** k_and_r\recipes\gaussj.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\gaussj.c Sat Dec 01 18:05:02 2001 *************** *** 27,29 **** } ! } else if (ipiv[k] > 1) nrerror("gaussj: Singular Matrix-1"); } --- 28,30 ---- } ! } } *************** *** 36,38 **** indxc[i]=icol; ! if (a[icol][icol] == 0.0) nrerror("gaussj: Singular Matrix-2"); pivinv=1.0/a[icol][icol]; --- 37,39 ---- indxc[i]=icol; ! if (a[icol][icol] == 0.0) nrerror("gaussj: Singular Matrix"); pivinv=1.0/a[icol][icol]; diff -r -b -B -c1 k_and_r\recipes\hqr.c ..\k_and_r\recipes\hqr.c *** k_and_r\recipes\hqr.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\hqr.c Sat Dec 01 18:05:02 2001 *************** *** 22,24 **** if (s == 0.0) s=anorm; ! if ((float)(fabs(a[l][l-1]) + s) == s) break; } --- 23,28 ---- if (s == 0.0) s=anorm; ! if ((float)(fabs(a[l][l-1]) + s) == s) { ! a[l][l-1]=0.0; ! break; ! } } diff -r -b -B -c1 k_and_r\recipes\iindexx.c ..\k_and_r\recipes\iindexx.c *** k_and_r\recipes\iindexx.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\iindexx.c Sat Dec 01 18:05:02 2001 *************** *** 20,22 **** a=arr[indxt]; ! for (i=j-1;i>=1;i--) { if (arr[indx[i]] <= a) break; --- 21,23 ---- a=arr[indxt]; ! for (i=j-1;i>=l;i--) { if (arr[indx[i]] <= a) break; *************** *** 32,36 **** SWAP(indx[k],indx[l+1]); - if (arr[indx[l+1]] > arr[indx[ir]]) { - SWAP(indx[l+1],indx[ir]) - } if (arr[indx[l]] > arr[indx[ir]]) { --- 33,34 ---- *************** *** 38,41 **** } ! if (arr[indx[l+1]] > arr[indx[l]]) { ! SWAP(indx[l+1],indx[l]) } --- 36,42 ---- } ! if (arr[indx[l+1]] > arr[indx[ir]]) { ! SWAP(indx[l+1],indx[ir]) ! } ! if (arr[indx[l]] > arr[indx[l+1]]) { ! SWAP(indx[l],indx[l+1]) } *************** *** 43,45 **** j=ir; ! indxt=indx[l]; a=arr[indxt]; --- 44,46 ---- j=ir; ! indxt=indx[l+1]; a=arr[indxt]; *************** *** 51,53 **** } ! indx[l]=indx[j]; indx[j]=indxt; --- 52,54 ---- } ! indx[l+1]=indx[j]; indx[j]=indxt; diff -r -b -B -c1 k_and_r\recipes\ludcmp.c ..\k_and_r\recipes\ludcmp.c *** k_and_r\recipes\ludcmp.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\ludcmp.c Sat Dec 01 18:05:02 2001 *************** *** 2,4 **** #include "nrutil.h" ! #define TINY 1.0e-20; --- 3,5 ---- #include "nrutil.h" ! #define TINY 1.0e-20 diff -r -b -B -c1 k_and_r\recipes\medfit.c ..\k_and_r\recipes\medfit.c *** k_and_r\recipes\medfit.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\medfit.c Sat Dec 01 18:05:02 2001 *************** *** 31,32 **** --- 32,34 ---- f1=rofunc(b1); + if (sigb > 0.0) { b2=bb+SIGN(3.0*sigb,f1); *************** *** 57,58 **** --- 59,61 ---- b2=bb; + } } diff -r -b -B -c1 k_and_r\recipes\mpdiv.c ..\k_and_r\recipes\mpdiv.c *** k_and_r\recipes\mpdiv.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\mpdiv.c Sat Dec 01 18:05:02 2001 *************** *** 15,17 **** mpmul(rr,s,u,n+MACC,n); ! mpsad(s,rr,n+n+MACC/2,1); mpmov(q,&s[2],n-m+1); --- 16,18 ---- mpmul(rr,s,u,n+MACC,n); ! mpsad(s,rr,n+MACC-1,1); mpmov(q,&s[2],n-m+1); diff -r -b -B -c1 k_and_r\recipes\pade.c ..\k_and_r\recipes\pade.c *** k_and_r\recipes\pade.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\pade.c Sat Dec 01 18:05:02 2001 *************** *** 36,40 **** } while (rr < rrold); ! *resid=sqrt(rr); for (k=1;k<=n;k++) { ! for (sum=cof[k],j=1;j<=k;j++) sum -= x[j]*cof[k-j]; y[k]=sum; --- 37,41 ---- } while (rr < rrold); ! *resid=sqrt(rrold); for (k=1;k<=n;k++) { ! for (sum=cof[k],j=1;j<=k;j++) sum -= z[j]*cof[k-j]; y[k]=sum; *************** *** 43,45 **** cof[j]=y[j]; ! cof[j+n] = -x[j]; } --- 44,46 ---- cof[j]=y[j]; ! cof[j+n] = -z[j]; } diff -r -b -B -c1 k_and_r\recipes\period.c ..\k_and_r\recipes\period.c *** k_and_r\recipes\period.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\period.c Sat Dec 01 18:05:02 2001 *************** *** 21,22 **** --- 22,24 ---- avevar(y,n,&ave,&var); + if (var == 0.0) nrerror("zero variance in period"); xmax=xmin=x[1]; diff -r -b -B -c1 k_and_r\recipes\qsimp.c ..\k_and_r\recipes\qsimp.c *** k_and_r\recipes\qsimp.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\qsimp.c Sat Dec 01 18:05:04 2001 *************** *** 10,14 **** int j; ! float s,st,ost,os; - ost = os = -1.0e30; for (j=1;j<=JMAX;j++) { --- 11,14 ---- int j; ! float s,st,ost=0.0,os=0.0; for (j=1;j<=JMAX;j++) { diff -r -b -B -c1 k_and_r\recipes\qtrap.c ..\k_and_r\recipes\qtrap.c *** k_and_r\recipes\qtrap.c Sat Dec 01 09:45:36 2001 --- ..\k_and_r\recipes\qtrap.c Sat Dec 01 18:05:04 2001 *************** *** 10,14 **** int j; ! float s,olds; - olds = -1.0e30; for (j=1;j<=JMAX;j++) { --- 11,14 ---- int j; ! float s,olds=0.0; for (j=1;j<=JMAX;j++) { diff -r -b -B -c1 k_and_r\recipes\ran3.c ..\k_and_r\recipes\ran3.c *** k_and_r\recipes\ran3.c Sat Dec 01 09:45:38 2001 --- ..\k_and_r\recipes\ran3.c Sat Dec 01 18:05:04 2001 *************** *** 1,2 **** ! #include #define MBIG 1000000000 --- 1,2 ---- ! #define MBIG 1000000000 diff -r -b -B -c1 k_and_r\recipes\rj.c ..\k_and_r\recipes\rj.c *** k_and_r\recipes\rj.c Sat Dec 01 09:45:38 2001 --- ..\k_and_r\recipes\rj.c Sat Dec 01 18:05:04 2001 *************** *** 21,24 **** ! if (FMIN(FMIN(x,y),z) < 0.0 || FMIN(FMIN(x+y,x+z),FMIN(y+z,fabs(p))) < TINY ! || FMAX(FMAX(x,y),FMAX(z,fabs(p))) > BIG) nrerror("invalid arguments in rj"); --- 22,25 ---- ! if (FMIN(FMIN(x,y),z) < 0.0 || FMIN(FMIN(FMIN(x+y,x+z),y+z),fabs(p)) < TINY ! || FMAX(FMAX(FMAX(x,y),z),fabs(p)) > BIG) nrerror("invalid arguments in rj"); *************** *** 60,63 **** delp=(ave-pt)/ave; ! } while (FMAX(FMAX(fabs(delx),fabs(dely)), ! FMAX(fabs(delz),fabs(delp))) > ERRTOL); ea=delx*(dely+delz)+dely*delz; --- 61,64 ---- delp=(ave-pt)/ave; ! } while (FMAX(FMAX(FMAX(fabs(delx),fabs(dely)), ! fabs(delz)),fabs(delp)) > ERRTOL); ea=delx*(dely+delz)+dely*delz; diff -r -b -B -c1 k_and_r\recipes\toeplz.c ..\k_and_r\recipes\toeplz.c *** k_and_r\recipes\toeplz.c Sat Dec 01 09:45:38 2001 --- ..\k_and_r\recipes\toeplz.c Sat Dec 01 18:05:04 2001 *************** *** 38,40 **** } ! if (sd == 0.0 || sgd == 0.0) nrerror("toeplz-3 singular principal minor"); g[m1]=sgn/sgd; --- 39,41 ---- } ! if (sgd == 0.0) nrerror("toeplz-3 singular principal minor"); g[m1]=sgn/sgd;