johna@van-bc.wimsey.bc.ca (John Altstadt) (06/15/90)
About a month ago, I posted a request that was met with underwhelming response. I am assuming that the reason for the lack of response was because of the lack of source code. In a nutshell, I wondered if MSC 6.0 had better floating point accuracy than 5.x. After some digging, I have been able to find the source code that was referenced, and I have appended it in a shar, along with my original posting. Flames about posting sources to csipp will be graciously ignored. John #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # msc_vs.tc # xmemcof.c # xspctrm.c # spctrl.dat # This archive created: Thu Jun 14 12:05:48 1990 export PATH; PATH=/bin:$PATH echo shar: extracting "'msc_vs.tc'" '(3306 characters)' if test -f 'msc_vs.tc' then echo shar: will not over-write existing file "'msc_vs.tc'" else cat << \SHAR_EOF > 'msc_vs.tc' Now that 6.0 is out, could somebody with the relevant source code handy (I am missing one of the two books referenced) try out the "benchmark" below and supply new results for Microsoft? More than one person must be interested. Letter from the June, 1989 issue of Byte magazine, pages 34 & 38: **** Recipe for Comparing Compilers "Smoothing Out C" by Steve Apiki and Jon Udell (Product Focus, February) was an informative article. However, the result that "Turbo... did poorly on the floating-point test" prompts me to relate data comparing Microsoft C and Turbo C using routines from the book _Numerical Recipes in C_ by William H. Press et al. (New York: Cambridge University Press, 1986.) (The FORTRAN/Pascal version of this book was reviewed in the January 1987 BYTE.) I needed a microcomputer C compiler for a spectral estimation project. Originally, I had intended to use the Microsoft compiler, since several coworkers had been using it and it had always been reliable. For this project, good numerical accuracy was far more important than execution speed. Although Microsoft C and Turbo C produced identical results for most of the _Numerical Recipes_ routines that I intended to use, Turbo C provided better accuracy in the two routines memcof.c and spctrm.c. I compared compilers by using the driver routines supplied in the companion book _Numerical Recipes Example Book (C)_. This book often gives the answers obtained when the routines were run by the authors. I tested the book's sample routines xspctrm.c and xmemcof.c using Microsoft C, Turbo C, and VAX-C (the latter on a DEC VAX-11/780 minicomputer). The results in tables 1 and 2 show why I selected Turbo C. Table 1: Results using the xmemcof.c driver routine. Published results appeared in _Numerical Recipes in C_. Index Published VAX-C Turbo C Microsoft C 1 1.261539 1.261540 1.261540 1.262617 2 -0.007695 -0.007694 -0.007694 -0.009724 3 -0.646778 -0.646779 -0.646779 -0.646527 4 -0.280603 -0.280603 -0.280603 -0.279950 5 0.163693 0.163692 0.163692 0.163249 6 0.347674 0.347676 0.347676 0.347373 7 0.111247 0.111247 0.111247 0.111045 8 -0.337141 -0.337142 -0.337142 -0.336187 9 -0.358043 -0.358043 -0.358043 -0.358086 10 0.378774 0.378774 0.378774 -0.378403 Table 2: Results using the xspctrm.c driver routine (overlapped case). Index Published VAX-C Turbo C Microsoft C 1 - 0.001993 0.001993 0.001786 2 - 0.001461 0.001461 0.002544 3 - 0.072356 0.072356 0.147874 4 - 0.062723 0.062723 0.107431 5 - 0.097625 0.097625 0.000332 6 - 0.014102 0.014102 0.000512 7 - 0.000089 0.000089 0.000113 8 - 0.000210 0.000210 0.000131 9 - 0.000052 0.000052 0.000037 **** I have tried to enter the numbers in the tables as carefully as possible. I may have messed up a digit or two. SHAR_EOF if test 3306 -ne "`wc -c < 'msc_vs.tc'`" then echo shar: error transmitting "'msc_vs.tc'" '(should have been 3306 characters)' fi fi # end of overwriting check echo shar: extracting "'xmemcof.c'" '(2203 characters)' if test -f 'xmemcof.c' then echo shar: will not over-write existing file "'xmemcof.c'" else cat << \SHAR_EOF > 'xmemcof.c' /* All required code has been appended to this file -- jma */ /* Driver for routine MEMCOF */ #include <stdio.h> #include <math.h> #include <alloc.h> #include <process.h> /* for exit() prototype */ float *vector(int nl, int nh); void nrerror(char error_text[]); void memcof(float data[], int n, int m, float *pm, float cof[]); void free_vector(float *v, int nl); #define N 1000 #define M 10 void main(void) { int i; float pm,*cof,*data; FILE *fp; cof=vector(1,M); data=vector(1,N); if ((fp = fopen("spctrl.dat","r")) == NULL) nrerror("Data file SPCTRL.DAT not found\n"); for (i=1;i<=N;i++) fscanf(fp,"%f",&data[i]); fclose(fp); memcof(data,N,M,&pm,cof); printf("Coefficients for spectral estimation of SPCTRL.DAT\n\n"); for (i=1;i<=M;i++) printf("a[%2d] = %12.6f \n",i,cof[i]); printf("\nb0 =%12.6f\n",pm); free_vector(data,1); free_vector(cof,1); } float *vector(int nl, int nh) { float *v; v=(float *)malloc((unsigned) (nh-nl+1)*sizeof(float)); if (!v) nrerror("allocation failure in vector()"); return v-nl; } void nrerror(char error_text[]) { fprintf(stderr,"Numerical Recipes run-time error...\n"); fprintf(stderr,"%s\n",error_text); fprintf(stderr,"...now exiting to system...\n"); exit(1); } static float sqrarg; #define SQR(a) (sqrarg=(a),sqrarg*sqrarg) void memcof(float data[], int n, int m, float *pm, float cof[]) { int k,j,i; float p=0.0,*wk1,*wk2,*wkm; wk1=vector(1,n); wk2=vector(1,n); wkm=vector(1,m); for (j=1;j<=n;j++) p += SQR(data[j]); *pm=p/n; wk1[1]=data[1]; wk2[n-1]=data[n]; for (j=2;j<=n-1;j++) { wk1[j]=data[j]; wk2[j-1]=data[j]; } for (k=1;k<=m;k++) { float num=0.0,denom=0.0; for (j=1;j<=(n-k);j++) { num += wk1[j]*wk2[j]; denom += SQR(wk1[j])+SQR(wk2[j]); } cof[k]=2.0*num/denom; *pm *= (1.0-SQR(cof[k])); if (k != 1) for (i=1;i<=(k-1);i++) cof[i]=wkm[i]-cof[k]*wkm[k-i]; if (k == m) { free_vector(wkm,1); free_vector(wk2,1); free_vector(wk1,1); return; } for (i=1;i<=k;i++) wkm[i]=cof[i]; for (j=1;j<=(n-k-1);j++) { wk1[j] -= wkm[k]*wk2[j]; wk2[j]=wk2[j+1]-wkm[k]*wk1[j+1]; } } } #undef SQR void free_vector(float *v, int nl) { free((char*) (v+nl)); } SHAR_EOF if test 2203 -ne "`wc -c < 'xmemcof.c'`" then echo shar: error transmitting "'xmemcof.c'" '(should have been 2203 characters)' fi fi # end of overwriting check echo shar: extracting "'xspctrm.c'" '(3696 characters)' if test -f 'xspctrm.c' then echo shar: will not over-write existing file "'xspctrm.c'" else cat << \SHAR_EOF > 'xspctrm.c' /* All required code has been appended to this file -- jma */ /* Driver for routine SPCTRM */ #include <stdio.h> #include <alloc.h> #include <math.h> #include <process.h> /* prototype for exit() */ float *vector(int nl, int nh); void nrerror(char error_text[]); void spctrm(FILE *fp, float p[], int m, int k, int ovrlap); void free_vector(float *v, int nl); void four1(float data[], int nn, int isign); #define M 16 #define TRUE 1 #define FALSE 0 void main(void) { int j,k,ovrlap; float *p,*q; FILE *fp; p=vector(1,M); q=vector(1,M); if ((fp = fopen("spctrl.dat","r")) == NULL) nrerror("Data file SPCTRL.DAT not found\n"); k=8; ovrlap=TRUE; spctrm(fp,p,M,k,ovrlap); rewind(fp); k=16; ovrlap=FALSE; spctrm(fp,q,M,k,ovrlap); fclose(fp); printf("\nSpectrum of data in file SPCTRL.DAT\n"); printf("%13s %s %5s %s\n"," ","overlapped "," ","non-overlapped"); for (j=1;j<=M;j++) printf("%3d %5s %13f %5s %13f\n",j," ",p[j]," ",q[j]); free_vector(q,1); free_vector(p,1); } float *vector(int nl, int nh) { float *v; v=(float *)malloc((unsigned) (nh-nl+1)*sizeof(float)); if (!v) nrerror("allocation failure in vector()"); return v-nl; } void nrerror(char error_text[]) { fprintf(stderr,"Numerical Recipes run-time error...\n"); fprintf(stderr,"%s\n",error_text); fprintf(stderr,"...now exiting to system...\n"); exit(1); } static float sqrarg; #define SQR(a) (sqrarg=(a),sqrarg*sqrarg) #define WINDOW(j,a,b) (1.0-fabs((((j)-1)-(a))*(b))) /* Parzen */ /* #define WINDOW(j,a,b) 1.0 */ /* Square */ /* #define WINDOW(j,a,b) (1.0-SQR((((j)-1)-(a))*(b))) */ /* Welch */ void spctrm(FILE *fp, float p[], int m, int k, int ovrlap) { int mm,m44,m43,m4,kk,joffn,joff,j2,j; float w,facp,facm,*w1,*w2,sumw=0.0,den=0.0; mm=m+m; m43=(m4=mm+mm)+3; m44=m43+1; w1=vector(1,m4); w2=vector(1,m); facm=m-0.5; facp=1.0/(m+0.5); for (j=1;j<=mm;j++) sumw += SQR(WINDOW(j,facm,facp)); for (j=1;j<=m;j++) p[j]=0.0; if (ovrlap) for (j=1;j<=m;j++) fscanf(fp,"%f",&w2[j]); for (kk=1;kk<=k;kk++) { for (joff = -1;joff<=0;joff++) { if (ovrlap) { for (j=1;j<=m;j++) w1[joff+j+j]=w2[j]; for (j=1;j<=m;j++) fscanf(fp,"%f",&w2[j]); joffn=joff+mm; for (j=1;j<=m;j++) w1[joffn+j+j]=w2[j]; } else { for (j=joff+2;j<=m4;j+=2) fscanf(fp,"%f",&w1[j]); } } for (j=1;j<=mm;j++) { j2=j+j; w=WINDOW(j,facm,facp); w1[j2] *= w; w1[j2-1] *= w; } four1(w1,mm,1); p[1] += (SQR(w1[1])+SQR(w1[2])); for (j=2;j<=m;j++) { j2=j+j; p[j] += (SQR(w1[j2])+SQR(w1[j2-1]) +SQR(w1[m44-j2])+SQR(w1[m43-j2])); } den += sumw; } den *= m4; for (j=1;j<=m;j++) p[j] /= den; free_vector(w2,1); free_vector(w1,1); } #undef SQR #undef WINDOW void free_vector(float *v, int nl) { free((char*) (v+nl)); } #define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr void four1(float data[], int nn, int isign) { int n,mmax,m,j,istep,i; double wtemp,wr,wpr,wpi,wi,theta; float tempr,tempi; n=nn << 1; j=1; for (i=1;i<n;i+=2) { if (j > i) { SWAP(data[j],data[i]); SWAP(data[j+1],data[i+1]); } m=n >> 1; while (m >= 2 && j > m) { j -= m; m >>= 1; } j += m; } mmax=2; while (n > mmax) { istep=2*mmax; theta=6.28318530717959/(isign*mmax); wtemp=sin(0.5*theta); wpr = -2.0*wtemp*wtemp; wpi=sin(theta); wr=1.0; wi=0.0; for (m=1;m<mmax;m+=2) { for (i=m;i<=n;i+=istep) { j=i+mmax; tempr=wr*data[j]-wi*data[j+1]; tempi=wr*data[j+1]+wi*data[j]; data[j]=data[i]-tempr; data[j+1]=data[i+1]-tempi; data[i] += tempr; data[i+1] += tempi; } wr=(wtemp=wr)*wpr-wi*wpi+wr; wi=wi*wpr+wtemp*wpi+wi; } mmax=istep; } } #undef SWAP SHAR_EOF if test 3696 -ne "`wc -c < 'xspctrm.c'`" then echo shar: error transmitting "'xspctrm.c'" '(should have been 3696 characters)' fi fi # end of overwriting check echo shar: extracting "'spctrl.dat'" '(15000 characters)' if test -f 'spctrl.dat' then echo shar: will not over-write existing file "'spctrl.dat'" else cat << \SHAR_EOF > 'spctrl.dat' 0.097911 0.367270 0.500363 0.425597 0.058794 -0.383898 -0.811678 -0.852240 -0.540416 0.077375 0.609527 0.949625 0.934536 0.547584 0.065175 -0.343537 -0.364521 -0.234990 -0.060539 0.070118 -0.053797 -0.195746 -0.378981 -0.302282 0.078039 0.496074 0.873213 0.920654 0.639311 0.016809 -0.545344 -0.847283 -0.757841 -0.419941 0.050494 0.412930 0.443676 0.355997 0.190416 0.004934 0.098812 0.334695 0.487672 0.390609 0.091482 -0.471872 -0.822832 -0.862922 -0.541732 0.037119 0.632220 0.969027 0.938331 0.524281 0.054555 -0.316386 -0.417168 -0.258567 -0.002089 0.081358 -0.010683 -0.250513 -0.395420 -0.292397 0.037531 0.541725 0.858324 0.979284 0.632282 0.052913 -0.513068 -0.861395 -0.844621 -0.381213 0.032628 0.441947 0.494978 0.353964 0.103450 0.050774 0.186340 0.348806 0.477618 0.439581 0.030414 -0.376526 -0.748378 -0.839505 -0.572722 0.070455 0.592158 0.997204 0.871991 0.573119 0.016951 -0.299401 -0.380699 -0.213378 -0.045667 0.014124 -0.083163 -0.211765 -0.394188 -0.329720 0.056738 0.487655 0.899056 0.923687 0.679856 0.053336 -0.580099 -0.898054 -0.777465 -0.449933 0.008536 0.397103 0.442733 0.382489 0.126694 0.008359 0.174158 0.298124 0.492837 0.387331 0.092230 -0.421991 -0.760395 -0.836616 -0.490595 0.002870 0.662405 0.970864 0.870277 0.485316 0.037991 -0.338729 -0.430330 -0.232343 -0.048044 0.032509 -0.019183 -0.230955 -0.379461 -0.286177 0.009042 0.568075 0.874133 0.912020 0.610105 0.098793 -0.487907 -0.815460 -0.839317 -0.455718 0.033628 0.359049 0.489247 0.299280 0.142992 0.076076 0.164557 0.331189 0.435143 0.371382 0.028573 -0.429901 -0.789573 -0.827289 -0.516383 0.019417 0.660162 0.998339 0.943339 0.553927 0.064096 -0.268127 -0.343639 -0.208262 -0.080817 0.014051 -0.091364 -0.251841 -0.332385 -0.253401 0.004142 0.562365 0.857352 0.980905 0.640451 0.070460 -0.560346 -0.860592 -0.800160 -0.411101 0.035681 0.419918 0.456588 0.380944 0.103726 0.061474 0.146002 0.335740 0.530424 0.424361 0.001236 -0.376993 -0.768314 -0.816661 -0.574880 0.001497 0.631647 0.908096 0.882109 0.558594 0.042774 -0.296324 -0.405426 -0.211205 -0.029234 0.085678 -0.036877 -0.276193 -0.370418 -0.333459 0.030051 0.509729 0.935126 0.962784 0.662392 0.072465 -0.579946 -0.894496 -0.846667 -0.445903 0.094651 0.436459 0.451768 0.372502 0.171457 0.074792 0.140627 0.311938 0.514634 0.414529 0.037810 -0.377700 -0.813998 -0.880491 -0.504330 0.016679 0.596882 0.918905 0.889236 0.478435 0.036437 -0.323710 -0.398283 -0.293001 -0.081568 0.036554 -0.019824 -0.221855 -0.387019 -0.334675 0.080294 0.491516 0.922518 0.963173 0.661262 0.013510 -0.562322 -0.893592 -0.764120 -0.466779 0.016865 0.438673 0.475335 0.347867 0.122441 0.095509 0.122242 0.374897 0.432223 0.394942 0.089702 -0.404219 -0.756637 -0.845088 -0.516642 0.039524 0.654199 0.984378 0.896149 0.525603 0.033058 -0.247243 -0.355035 -0.228370 0.007792 0.008678 -0.064855 -0.231288 -0.374441 -0.332992 0.005931 0.508226 0.942214 1.002574 0.586029 0.075539 -0.508032 -0.893993 -0.798908 -0.387166 0.083562 0.384966 0.487865 0.332096 0.181928 0.008358 0.135767 0.352306 0.478585 0.401968 0.054226 -0.399437 -0.819389 -0.826667 -0.533762 0.002544 0.677559 0.921943 0.884705 0.488659 0.032441 -0.260313 -0.387379 -0.218315 -0.088176 0.045573 -0.084575 -0.283227 -0.431495 -0.305018 0.020692 0.495659 0.903865 0.979479 0.641578 0.096499 -0.532013 -0.818501 -0.801651 -0.458958 0.051335 0.414244 0.489763 0.336589 0.117080 0.084142 0.125365 0.301872 0.512340 0.445291 0.073475 -0.448532 -0.801094 -0.842954 -0.528140 0.025966 0.603184 0.946022 0.882719 0.539963 0.098792 -0.289700 -0.387006 -0.195881 -0.081170 0.023650 -0.026617 -0.253341 -0.408916 -0.343958 0.066436 0.554518 0.915065 0.979764 0.615021 0.095966 -0.535727 -0.900540 -0.747872 -0.456808 0.018016 0.432158 0.453624 0.354854 0.139914 0.073312 0.107453 0.362039 0.483963 0.428043 0.095897 -0.416062 -0.752085 -0.881777 -0.506618 0.019157 0.634220 0.906013 0.942182 0.536385 0.055480 -0.316476 -0.351742 -0.213961 -0.053189 0.060703 0.001519 -0.246973 -0.384560 -0.331215 0.009580 0.493835 0.911937 0.951883 0.603137 0.054710 -0.524431 -0.897798 -0.780356 -0.408528 0.033938 0.424251 0.528502 0.376326 0.176091 0.045445 0.164536 0.375618 0.525160 0.426136 0.008985 -0.447627 -0.807413 -0.859091 -0.559236 0.011335 0.590186 0.936487 0.856904 0.530043 0.012522 -0.335937 -0.412646 -0.209519 -0.053693 0.051147 -0.053526 -0.222614 -0.410404 -0.279051 0.019434 0.520151 0.924055 0.905338 0.599860 0.072868 -0.495636 -0.852138 -0.842475 -0.410295 0.045931 0.374146 0.507044 0.304955 0.110229 0.014329 0.099445 0.313920 0.442175 0.440693 0.057408 -0.424944 -0.804769 -0.813377 -0.567945 0.061968 0.598933 0.986802 0.848188 0.515720 0.047513 -0.329140 -0.349152 -0.242236 -0.078811 0.079854 -0.024022 -0.265492 -0.355148 -0.309431 0.096588 0.575235 0.849259 0.941124 0.595528 0.055573 -0.503313 -0.883673 -0.816723 -0.439862 0.048003 0.440092 0.494922 0.379278 0.180705 0.057666 0.108089 0.332832 0.464212 0.374919 0.021429 -0.471234 -0.757271 -0.809901 -0.497724 0.082059 0.657500 0.948854 0.896929 0.511290 0.073270 -0.317564 -0.361846 -0.280574 -0.033892 0.037408 -0.073339 -0.285403 -0.429735 -0.246847 0.031412 0.567831 0.933083 0.974899 0.648928 0.090599 -0.513837 -0.874769 -0.778362 -0.450210 0.063260 0.403755 0.485675 0.325856 0.126301 0.056894 0.153595 0.366111 0.464019 0.377563 0.004612 -0.414628 -0.761011 -0.867799 -0.499577 0.091861 0.654241 0.997871 0.942204 0.483009 0.091923 -0.335708 -0.338226 -0.278998 -0.008505 0.053219 -0.058173 -0.219469 -0.352340 -0.302103 0.052941 0.528985 0.893284 0.981896 0.606492 0.065509 -0.534164 -0.857461 -0.802981 -0.388117 0.004868 0.442722 0.435563 0.314212 0.183261 0.077975 0.176073 0.295736 0.482821 0.374858 0.076716 -0.422508 -0.837674 -0.807773 -0.531693 0.074174 0.649856 0.953869 0.851023 0.573365 0.006548 -0.324274 -0.335403 -0.199929 0.004564 0.097017 -0.040870 -0.271010 -0.415173 -0.263773 0.018949 0.509171 0.912486 0.909274 0.663260 0.016081 -0.488704 -0.868258 -0.747901 -0.388979 0.024781 0.367971 0.522698 0.305092 0.186602 0.098019 0.166066 0.381537 0.442624 0.424076 0.025891 -0.452799 -0.814807 -0.810631 -0.572332 0.070288 0.605258 0.956582 0.903865 0.495041 0.050691 -0.276583 -0.421594 -0.278223 -0.006641 0.091677 -0.035410 -0.200884 -0.356414 -0.292225 0.088560 0.537159 0.860301 0.960125 0.597692 0.067915 -0.500009 -0.852144 -0.810110 -0.401515 0.002545 0.396196 0.437215 0.334308 0.113528 0.034839 0.154359 0.297152 0.512050 0.402023 0.053790 -0.411957 -0.776809 -0.804607 -0.545230 0.004483 0.606468 1.004181 0.877637 0.520703 0.014247 -0.327739 -0.427206 -0.228288 -0.067409 0.002191 -0.059131 -0.221008 -0.343540 -0.253384 0.047465 0.485443 0.899890 0.910847 0.663669 0.037764 -0.517929 -0.876655 -0.751527 -0.433621 0.018924 0.441145 0.523340 0.391304 0.156069 0.020190 0.184455 0.323097 0.455107 0.361767 0.089370 -0.385349 -0.794025 -0.903242 -0.532589 0.034371 0.668037 0.928333 0.929222 0.547698 0.097208 -0.311597 -0.367236 -0.232687 -0.051130 0.048259 -0.060719 -0.260017 -0.418074 -0.303872 0.072928 0.484907 0.855767 0.976362 0.610166 0.014785 -0.486794 -0.846244 -0.748778 -0.394212 0.009820 0.358356 0.526840 0.354162 0.190473 0.028436 0.176236 0.322849 0.462059 0.370479 0.064294 -0.384773 -0.792332 -0.806280 -0.523412 0.078413 0.661642 0.926860 0.922979 0.544351 0.025883 -0.340230 -0.354519 -0.247419 -0.003119 0.082101 -0.012022 -0.198200 -0.391275 -0.330999 0.072228 0.554047 0.940904 0.963250 0.607121 0.019336 -0.555746 -0.832664 -0.760450 -0.395728 0.061648 0.383536 0.522079 0.316498 0.134781 0.021790 0.168653 0.344387 0.485338 0.429979 0.091185 -0.386099 -0.803865 -0.847632 -0.547286 0.015153 0.586225 0.939693 0.849235 0.559308 0.012852 -0.294433 -0.399566 -0.258405 -0.066580 0.087800 -0.042150 -0.269474 -0.332681 -0.322917 0.056257 0.541328 0.884606 0.941629 0.630189 0.065754 -0.561263 -0.903853 -0.790730 -0.450923 0.096406 0.379047 0.518242 0.362239 0.096277 0.042876 0.161780 0.378011 0.458697 0.358680 0.082284 -0.444665 -0.803149 -0.815407 -0.489638 0.091010 0.635438 0.941832 0.856547 0.564492 0.099813 -0.318179 -0.419672 -0.290083 -0.013989 0.083569 -0.055919 -0.257622 -0.430436 -0.277385 0.006100 0.515979 0.908006 0.993760 0.618310 0.001543 -0.535351 -0.899117 -0.829096 -0.456206 0.000256 0.376039 0.480801 0.382116 0.150624 0.018162 0.166605 0.306360 0.447567 0.406553 0.077535 -0.439301 -0.842485 -0.819257 -0.544317 0.078440 0.623969 0.977282 0.903853 0.526331 0.094650 -0.329740 -0.350568 -0.286092 -0.062614 0.015146 -0.088102 -0.281699 -0.397238 -0.311890 0.036393 0.481938 0.889484 0.955059 0.662317 0.005069 -0.503866 -0.861251 -0.781591 -0.391141 0.042585 0.378318 0.520022 0.321098 0.110956 0.008048 0.139262 0.313787 0.474640 0.407562 0.058446 -0.454213 -0.845370 -0.813975 -0.480999 0.010004 0.665455 0.931345 0.931231 0.562228 0.023416 -0.256999 -0.333008 -0.200222 -0.044808 0.065249 -0.071637 -0.273911 -0.332033 -0.306899 0.020117 0.480633 0.907756 0.986501 0.596889 0.038615 -0.566205 -0.817764 -0.756176 -0.403098 0.035555 0.444095 0.510418 0.307940 0.179051 0.061500 0.098928 0.345776 0.464550 0.435004 0.060468 -0.383262 -0.788087 -0.831224 -0.523793 0.033440 0.633217 0.944808 0.920680 0.483308 0.058446 -0.254890 -0.402245 -0.206168 0.002455 0.098080 0.001098 -0.204013 -0.342597 -0.276006 0.076104 0.519721 0.848375 0.954724 0.595388 0.017591 -0.554098 -0.823085 -0.832739 -0.394980 0.031532 0.407808 0.506202 0.365729 0.112260 0.015105 0.156834 0.390595 0.502499 0.376821 0.022250 -0.468862 -0.828902 -0.865065 -0.521754 0.008702 0.582262 0.990812 0.858668 0.479814 0.004871 -0.339759 -0.382635 -0.254824 -0.058774 0.040762 -0.064244 -0.207980 -0.406088 -0.248284 0.065140 0.502790 0.909789 0.948749 0.594440 0.095172 -0.482355 -0.813955 -0.750694 -0.449014 0.038131 0.432970 0.460675 0.310682 0.140371 0.003175 0.148347 0.304243 0.480985 0.429534 0.059744 -0.451427 -0.761063 -0.903347 -0.542992 0.066439 0.606244 0.972373 0.849850 0.538147 0.037460 -0.270762 -0.385688 -0.243512 -0.051111 0.040176 -0.046009 -0.222313 -0.415061 -0.344722 0.065446 0.521380 0.896401 0.990178 0.672997 0.031288 -0.488687 -0.839813 -0.747661 -0.454405 0.003323 0.431151 0.498745 0.359902 0.147358 0.026276 0.119546 0.357631 0.468306 0.368227 0.007975 -0.405726 -0.835639 -0.826552 -0.498900 0.075505 0.610725 0.999256 0.849490 0.538016 0.030475 -0.274609 -0.394095 -0.244471 -0.007600 0.048182 -0.090882 -0.213751 -0.363397 -0.248384 0.085440 0.574230 0.947322 0.982645 0.653703 0.025142 -0.537558 -0.809595 -0.807243 -0.444492 0.099258 0.365283 0.499182 0.301096 0.155158 0.094121 0.180500 0.367823 0.453490 0.358748 0.090581 -0.409058 -0.779713 -0.805878 -0.572210 0.007475 0.614132 0.921802 0.927101 0.504223 0.068253 -0.268464 -0.380833 -0.238024 -0.012982 0.007172 -0.009599 -0.259873 -0.391673 -0.293916 0.070242 0.564174 0.881125 0.968656 0.648719 0.063631 -0.568027 -0.824792 -0.806184 -0.454851 0.026379 0.404643 0.448427 0.351062 0.126076 0.097715 0.138137 0.355728 0.525115 0.349266 0.055674 -0.447023 -0.779438 -0.871175 -0.572309 0.074596 0.583332 0.926666 0.866427 0.571239 0.061118 -0.282493 -0.340329 -0.231417 -0.031789 0.092093 -0.067833 -0.236263 -0.415730 -0.255997 0.061875 0.484668 0.912390 0.998998 0.608189 0.011819 -0.575031 -0.844429 -0.785034 -0.465118 0.005862 0.381676 0.500147 0.331682 0.186613 0.002278 SHAR_EOF if test 15000 -ne "`wc -c < 'spctrl.dat'`" then echo shar: error transmitting "'spctrl.dat'" '(should have been 15000 characters)' fi fi # end of overwriting check # End of shell archive exit 0 -- John Altstadt, 6135 Carson St., Burnaby B.C., CANADA, V5J 2Z8 ..!ubc-cs!van-bc!johna || ..!uunet!van-bc!johna || johna@wimsey.bc.ca There may, or there may not have been some :-)s up there. There should probably have been a few more for the humorless, lost souls out there.
kdq@demott.COM (Kevin D. Quitt) (06/16/90)
Results from MSC 6.0 First column under Microsoft uses in-line 80x87 instructions (/FPi87), second column is for both 8087-compatible library calls (no fpu: /FPc), and for their alternate math library (/FPa). All compilations were otherwise: /AS /Od /Zp1 /G1 Table 1: Results using the xmemcof.c driver routine. Published results appeared in _Numerical Recipes in C_. Index Published VAX-C Turbo C Microsoft C 1 1.261539 1.261540 1.261540 1.261539 1.261540 2 -0.007695 -0.007694 -0.007694 -0.007695 -0.007693 3 -0.646778 -0.646779 -0.646779 -0.646777 -0.646780 4 -0.280603 -0.280603 -0.280603 -0.280602 -0.280604 5 0.163693 0.163692 0.163692 0.163691 0.163693 6 0.347674 0.347676 0.347676 0.347675 0.347676 7 0.111247 0.111247 0.111247 0.111247 0.111247 8 -0.337141 -0.337142 -0.337142 -0.337141 -0.337142 9 -0.358043 -0.358043 -0.358043 -0.358044 -0.358043 10 0.378774 0.378774 0.378774 0.378775 0.378774 Table 2: Results using the xspctrm.c driver routine (overlapped case). Index Published VAX-C Turbo C Microsoft C 1 - 0.001993 0.001993 0.001993 0.001993 2 - 0.001461 0.001461 0.001461 0.001461 3 - 0.072356 0.072356 0.072356 0.072356 4 - 0.062723 0.062723 0.062723 0.062723 5 - 0.097625 0.097625 0.097625 0.097625 6 - 0.014102 0.014102 0.014102 0.014102 7 - 0.000089 0.000089 0.000089 0.000089 8 - 0.000210 0.000210 0.000210 0.000210 9 - 0.000052 0.000052 0.000052 0.000052 Compiling with 5.1, I was able to duplicate the erroneous results only by selecting the emulation library, and not using the 80x87 instructions. This is a farily bizarre thing to do if you don't have a coprocessor, you should be using the alt-math library, since it's significantly faster than the emulator. It also produces the correct answers. I have yet to find a compiler (on any machine) whose default switches were satisfactory even most of the time. -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last 96.37% of all statistics are made up.