Commits

brunoro  committed f19f554

updating benchmarks

* addded Stanford benchmark.

  • Participants
  • Parent commits 1f6379b

Comments (0)

Files changed (62)

File benchmark/Stanford/Bubblesort.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+
+    /* Sorts an array using bubblesort */
+
+void bInitarr()	{
+	int i;
+	long temp; /* converted temp to long for 16 bit WR*/
+	Initrand();
+	biggest = 0; littlest = 0;
+	for ( i = 1; i <= srtelements; i++ ) {
+	    temp = Rand();
+	    /* converted constants to long in next stmt, typecast back to int WR*/
+	    sortlist[i] = (int)(temp - (temp/100000L)*100000L - 50000L);
+	    if ( sortlist[i] > biggest ) biggest = sortlist[i];
+	    else if ( sortlist[i] < littlest ) littlest = sortlist[i];
+	}
+}
+
+void Bubble(int run) {
+	int i, j;
+	bInitarr();
+	top=srtelements;
+	
+	while ( top>1 ) {
+		
+		i=1;
+		while ( i<top ) {
+			
+			if ( sortlist[i] > sortlist[i+1] ) {
+				j = sortlist[i];
+				sortlist[i] = sortlist[i+1];
+				sortlist[i+1] = j;
+			}
+			i=i+1;
+		}
+		
+		top=top-1;
+	}
+	if ( (sortlist[1] != littlest) || (sortlist[srtelements] != biggest) )
+	printf ( "Error3 in Bubble.\n");
+	printf("%d\n", sortlist[run + 1]);
+}
+
+int main()
+{
+	int i;
+	for (i = 0; i < 100; i++) Bubble(i);
+	return 0;
+}

File benchmark/Stanford/Bubblesort.reference_output

+-50000
+-49783
+-49692
+-49678
+-49470
+-49442
+-49423
+-49393
+-49388
+-49184
+-48907
+-48821
+-48807
+-48750
+-48705
+-48704
+-48454
+-48432
+-47989
+-47757
+-47642
+-47607
+-47503
+-47378
+-47284
+-47206
+-47156
+-47152
+-46907
+-46856
+-46737
+-46734
+-46323
+-46122
+-45996
+-45765
+-45583
+-45547
+-45431
+-45322
+-45290
+-44932
+-44759
+-44411
+-44378
+-44344
+-44163
+-44089
+-44053
+-43907
+-43809
+-43671
+-43623
+-43588
+-43400
+-43373
+-43255
+-43129
+-42918
+-42791
+-42427
+-42191
+-42101
+-42057
+-41994
+-41976
+-41632
+-41313
+-40933
+-40713
+-40665
+-40503
+-40392
+-40014
+-39944
+-39905
+-39878
+-39872
+-39853
+-39848
+-39788
+-39774
+-39455
+-39398
+-39387
+-38809
+-38547
+-38351
+-38347
+-38333
+-38309
+-38301
+-38259
+-38193
+-38015
+-37987
+-37795
+-37786
+-37434
+-37366
+exit 0

File benchmark/Stanford/EXAMPLE

+run.sh ../bin clone-constant-args ../lib/CloneConstants.so 

File benchmark/Stanford/FloatMM.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+
+    /* Multiplies two real matrices. */
+
+void rInitmatrix ( float m[rowsize+1][rowsize+1] ) {
+	int temp, i, j;
+	for ( i = 1; i <= rowsize; i++ )
+	    for ( j = 1; j <= rowsize; j++ ) {
+	    	temp = Rand();
+			m[i][j] = (float)(temp - (temp/120)*120 - 60)/3;
+        }
+}
+
+void rInnerproduct(float *result, float a[rowsize+1][rowsize+1], float b[rowsize+1][rowsize+1], int row, int column) {
+	/* computes the inner product of A[row,*] and B[*,column] */
+	int i;
+	*result = 0.0f;
+	for (i = 1; i<=rowsize; i++) *result = *result+a[row][i]*b[i][column];
+}
+
+void Mm (int run)    {
+    int i, j;
+    Initrand();
+    rInitmatrix (rma);
+    rInitmatrix (rmb);
+    for ( i = 1; i <= rowsize; i++ )
+		for ( j = 1; j <= rowsize; j++ ) 
+			rInnerproduct(&rmr[i][j],rma,rmb,i,j);
+    if (run < rowsize)
+      printf("%f\n", rmr[run + 1][run + 1]);
+}
+
+int main()
+{
+	int i;
+	for (i = 0; i < 5000; i++) Mm(i);
+	return 0;
+}

File benchmark/Stanford/FloatMM.reference_output

+-776.000000
+636.888889
+961.777778
+-239.555556
+-337.777778
+-298.222222
+-962.666667
+94.666667
+62.222222
+33.333333
+-1002.666667
+-619.111111
+-52.444444
+1117.777778
+-535.999999
+316.888889
+1649.777778
+204.888889
+292.444444
+851.111111
+-221.333333
+1389.777778
+837.333333
+623.555556
+46.222222
+1048.444444
+17.777778
+-333.777778
+-712.000000
+94.666667
+643.555556
+-1310.666667
+-279.999999
+602.222222
+-11.555556
+-64.444445
+146.666667
+119.555556
+204.444444
+607.555556
+exit 0

File benchmark/Stanford/IntMM.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+
+    /* Multiplies two integer matrices. */
+
+void Initmatrix (int m[rowsize+1][rowsize+1]) {
+	int temp, i, j;
+	for ( i = 1; i <= rowsize; i++ )
+	    for ( j = 1; j <= rowsize; j++ ) {
+	    temp = Rand();
+		m[i][j] = temp - (temp/120)*120 - 60;
+	}
+}
+
+void Innerproduct( int *result, int a[rowsize+1][rowsize+1], int b[rowsize+1][rowsize+1], int row, int column) {
+	/* computes the inner product of A[row,*] and B[*,column] */
+	int i;
+	*result = 0;
+	for(i = 1; i <= rowsize; i++ )*result = *result+a[row][i]*b[i][column];
+}
+
+void Intmm (int run) {
+    int i, j;
+    Initrand();
+    Initmatrix (ima);
+    Initmatrix (imb);
+    for ( i = 1; i <= rowsize; i++ )
+		for ( j = 1; j <= rowsize; j++ )
+			Innerproduct(&imr[i][j],ima,imb,i,j);
+	printf("%d\n", imr[run + 1][run + 1]);
+}
+
+int main()
+{
+	int i;
+	for (i = 0; i < 10; i++) Intmm(i);
+	return 0;
+}

File benchmark/Stanford/IntMM.reference_output

+-6984
+5732
+8656
+-2156
+-3040
+-2684
+-8664
+852
+560
+300
+exit 0

File benchmark/Stanford/Makefile

+LEVEL = ../../..
+LDFLAGS += -lm
+FP_TOLERANCE = 0.001
+
+include $(LEVEL)/SingleSource/Makefile.singlesrc

File benchmark/Stanford/Oscar.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256
+#define fftsize2 	 129
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node
+{
+  struct node *left, *right;
+  int val;
+};
+
+		 /* Towers *//*
+		    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct element
+{
+  int discsize;
+  int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+		    /* Intmm, Mm *//*
+		       index = 1 .. rowsize;
+		       intmatrix = array [index,index] of integer;
+		       realmatrix = array [index,index] of real;
+		     */
+		 /* Puzzle *//*
+		    piececlass = 0..classmax;
+		    piecetype = 0..typemax;
+		    position = 0..size;
+		  */
+			/* Bubble, Quick *//*
+			   listsize = 0..sortelements;
+			   sortarray = array [listsize] of integer;
+			 */
+    /* FFT */
+struct complex
+{
+  float rp, ip;
+};
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long seed;			/* converted to long for 16 bit WR */
+
+    /* Perm */
+int permarray[permrange + 1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int stack[stackrange + 1];
+struct element cellspace[maxcells + 1];
+int freelist, movesdone;
+
+    /* Intmm, Mm */
+
+int ima[rowsize + 1][rowsize + 1], imb[rowsize + 1][rowsize + 1],
+  imr[rowsize + 1][rowsize + 1];
+float rma[rowsize + 1][rowsize + 1], rmb[rowsize + 1][rowsize + 1],
+  rmr[rowsize + 1][rowsize + 1];
+
+    /* Puzzle */
+int piececount[classmax + 1], class[typemax + 1], piecemax[typemax + 1];
+int puzzl[size + 1], p[typemax + 1][size + 1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements + 1], biggest, littlest, top;
+
+    /* FFT */
+struct complex z[fftsize + 1], w[fftsize + 1], e[fftsize2 + 1];
+float zr, zi;
+
+void
+Initrand ()
+{
+  seed = 74755L;		/* constant to long WR */
+}
+
+int
+Rand ()
+{
+  seed = (seed * 1309L + 13849L) & 65535L;	/* constants to long WR */
+  return ((int) seed);		/* typecast back to int WR */
+}
+
+
+float
+Cos (float x)
+{
+/* computes cos of x (x in radians) by an expansion */
+  int i, factor;
+  float result, power;
+
+  result = 1.0f;
+  factor = 1;
+  power = x;
+  for (i = 2; i <= 10; i++)
+    {
+      factor = factor * i;
+      power = power * x;
+      if ((i & 1) == 0)
+	{
+	  if ((i & 3) == 0)
+	    result = result + power / factor;
+	  else
+	    result = result - power / factor;
+	}
+    }
+  return (result);
+}
+
+int
+Min0 (int arg1, int arg2)
+{
+  if (arg1 < arg2)
+    return (arg1);
+  else
+    return (arg2);
+}
+
+void
+Printcomplex (struct complex zarray[], int start, int finish, int increment)
+{				/* removed unused arg1, arg2 arguments WR */
+  int i;
+  printf ("\n");
+
+  i = start;
+  do
+    {
+      printf ("  %15.3f%15.3f", zarray[i].rp, zarray[i].ip);
+      i = i + increment;
+      printf ("  %15.3f%15.3f", zarray[i].rp, zarray[i].ip);
+      printf ("\n");
+      i = i + increment;
+    }
+  while (i <= finish);
+
+}
+
+void
+Uniform11 (int *iy, float *yfl)
+{
+  *iy = (4855 * *iy + 1731) & 8191;
+  *yfl = *iy / 8192.0f;
+}				/* uniform */
+
+void
+Exptab (int n, struct complex e[])
+{				/* exptab */
+  float theta, divisor, h[26];
+  int i, j, k, l, m;
+
+  theta = 3.1415926536f;
+  divisor = 4.0f;
+  for (i = 1; i <= 25; i++)
+    {
+      h[i] = 1 / (2 * Cos (theta / divisor));
+      divisor = divisor + divisor;
+    }
+
+  m = n / 2;
+  l = m / 2;
+  j = 1;
+  e[1].rp = 1.0f;
+  e[1].ip = 0.0f;
+  e[l + 1].rp = 0.0f;
+  e[l + 1].ip = 1.0f;
+  e[m + 1].rp = -1.0f;
+  e[m + 1].ip = 0.0f;
+
+  do
+    {
+      i = l / 2;
+      k = i;
+
+      do
+	{
+	  e[k + 1].rp = h[j] * (e[k + i + 1].rp + e[k - i + 1].rp);
+	  e[k + 1].ip = h[j] * (e[k + i + 1].ip + e[k - i + 1].ip);
+	  k = k + l;
+	}
+      while (k <= m);
+
+      j = Min0 (j + 1, 25);
+      l = i;
+    }
+  while (l > 1);
+
+}				/* exptab */
+
+void
+Fft (int n, struct complex z[], struct complex w[], struct complex e[],
+     float sqrinv)
+{
+  int i, j, k, l, m, index;
+  m = n / 2;
+  l = 1;
+
+  do
+    {
+      k = 0;
+      j = l;
+      i = 1;
+
+      do
+	{
+
+	  do
+	    {
+	      w[i + k].rp = z[i].rp + z[m + i].rp;
+	      w[i + k].ip = z[i].ip + z[m + i].ip;
+	      w[i + j].rp = e[k + 1].rp * (z[i].rp - z[i + m].rp)
+		- e[k + 1].ip * (z[i].ip - z[i + m].ip);
+	      w[i + j].ip = e[k + 1].rp * (z[i].ip - z[i + m].ip)
+		+ e[k + 1].ip * (z[i].rp - z[i + m].rp);
+	      i = i + 1;
+	    }
+	  while (i <= j);
+
+	  k = j;
+	  j = k + l;
+	}
+      while (j <= m);
+
+      /*z = w ; */ index = 1;
+      do
+	{
+	  z[index] = w[index];
+	  index = index + 1;
+	}
+      while (index <= n);
+      l = l + l;
+    }
+  while (l <= m);
+
+  for (i = 1; i <= n; i++)
+    {
+      z[i].rp = sqrinv * z[i].rp;
+      z[i].ip = -sqrinv * z[i].ip;
+    }
+
+}
+
+void
+Oscar ()
+{				/* oscar */
+  int i;
+  Exptab (fftsize, e);
+  seed = 5767;
+  for (i = 1; i <= fftsize; i++)
+    {
+      int s = seed;
+      Uniform11 (&s, &zr);	/* typecast seed for 16 bit WR */
+      seed = s;
+      Uniform11 (&s, &zi);	/* typecast seed for 16 bit WR */
+      seed = s;
+      z[i].rp = 20.0f * zr - 10.0f;
+      z[i].ip = 20.0f * zi - 10.0f;
+    }
+  for (i = 1; i <= 20; i++)
+    {
+      Fft (fftsize, z, w, e, 0.0625f);
+    }
+  Printcomplex (z, 1, 256, 17);	/* removed 1st 2 args 6, 99, unused by printcomplex WR */
+}				/* oscar */
+
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 10; i++)
+    Oscar ();
+  return 0;
+}

File benchmark/Stanford/Oscar.reference_output

+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+
+           -9.365         -3.987           -7.705         -3.928
+            1.768          5.818            4.053          0.251
+            4.150         -5.627            7.061          3.181
+           -2.217          1.677            1.318          4.861
+            2.666          7.732            6.826          5.291
+           -1.201         -7.463            3.584          4.470
+            6.182         -3.909           -8.408          2.400
+            4.814         -1.604           -9.150         -0.920
+exit 0

File benchmark/Stanford/Perm.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+    /* Permutation program, heavily recursive, written by Denny Brown. */
+
+void Swap ( int *a, int *b ) {
+	int t;
+	t = *a;  *a = *b;  *b = t;
+}
+
+void Initialize () {
+	int i;
+	for ( i = 1; i <= 7; i++ ) {
+	    permarray[i]=i-1;
+	}
+}
+
+void Permute (int n) {   /* permute */
+	int k;
+	pctr = pctr + 1;
+	if ( n!=1 )  {
+	    Permute(n-1);
+	    for ( k = n-1; k >= 1; k-- ) {
+			Swap(&permarray[n],&permarray[k]);
+			Permute(n-1);
+			Swap(&permarray[n],&permarray[k]);
+		}
+    }
+}     /* permute */
+
+void Perm ()    {   /* Perm */
+    int i;
+    pctr = 0;
+    for ( i = 1; i <= 5; i++ ) {
+		Initialize();
+		Permute(7);
+	}
+    if ( pctr != 43300 )
+	printf(" Error in Perm.\n");
+	printf("%d\n", pctr);
+}     /* Perm */
+
+int main()
+{
+	int i;
+	for (i = 0; i < 100; i++) Perm();
+	return 0;
+}
+

File benchmark/Stanford/Perm.reference_output

+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+43300
+exit 0

File benchmark/Stanford/Puzzle.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+
+
+    /* A compute-bound program from Forest Baskett. */
+
+int Fit (int i, int j) {
+	int k;
+	for ( k = 0; k <= piecemax[i]; k++ )
+	    if ( p[i][k] ) if ( puzzl[j+k] ) return (false);
+	return (true);
+}
+
+int Place (int i, int j) {
+	int k;
+	for ( k = 0; k <= piecemax[i]; k++ ) if ( p[i][k] ) puzzl[j+k] = true;
+	piececount[class[i]] = piececount[class[i]] - 1;
+	for ( k = j; k <= size; k++ ) if ( ! puzzl[k] ) return (k);
+	return (0);
+}
+
+void Remove (int i, int j) {
+	int k;
+	for ( k = 0; k <= piecemax[i]; k++ ) if ( p[i][k] ) puzzl[j+k] = false;
+	piececount[class[i]] = piececount[class[i]] + 1;
+}
+
+int Trial (int j) {
+	int i, k;
+	kount = kount + 1;
+	for ( i = 0; i <= typemax; i++ )
+	    if ( piececount[class[i]] != 0 )
+		if ( Fit (i, j) ) {
+		    k = Place (i, j);
+		    if ( Trial(k) || (k == 0) )return (true);
+			else Remove (i, j);
+		}
+	return (false);
+}
+
+void Puzzle ()  {
+    int i, j, k, m;
+    for ( m = 0; m <= size; m++ ) puzzl[m] = true;
+    for( i = 1; i <= 5; i++ )for( j = 1; j <= 5; j++ )for( k = 1; k <= 5; k++ )	puzzl[i+d*(j+d*k)] = false;
+    for( i = 0; i <= typemax; i++ )for( m = 0; m<= size; m++ ) p[i][m] = false;
+    for( i = 0; i <= 3; i++ )for( j = 0; j <= 1; j++ )for( k = 0; k <= 0; k++ ) p[0][i+d*(j+d*k)] = true;
+    class[0] = 0;
+    piecemax[0] = 3+d*1+d*d*0;
+    for( i = 0; i <= 1; i++ )for( j = 0; j <= 0; j++ )for( k = 0; k <= 3; k++ )	p[1][i+d*(j+d*k)] = true;
+    class[1] = 0;
+    piecemax[1] = 1+d*0+d*d*3;
+    for( i = 0; i <= 0; i++ )for( j = 0; j <= 3; j++ )for( k = 0; k <= 1; k++ )	p[2][i+d*(j+d*k)] = true;
+    class[2] = 0;
+    piecemax[2] = 0+d*3+d*d*1;
+    for( i = 0; i <= 1; i++ )for( j = 0; j <= 3; j++ )for( k = 0; k <= 0; k++ )	p[3][i+d*(j+d*k)] = true;
+    class[3] = 0;
+    piecemax[3] = 1+d*3+d*d*0;
+    for( i = 0; i <= 3; i++ )for( j = 0; j <= 0; j++ )for( k = 0; k <= 1; k++ )	p[4][i+d*(j+d*k)] = true;
+    class[4] = 0;
+    piecemax[4] = 3+d*0+d*d*1;
+    for( i = 0; i <= 0; i++ )for( j = 0; j <= 1; j++ )for( k = 0; k <= 3; k++ )	p[5][i+d*(j+d*k)] = true;
+    class[5] = 0;
+    piecemax[5] = 0+d*1+d*d*3;
+    for( i = 0; i <= 2; i++ )for( j = 0; j <= 0; j++ )for( k = 0; k <= 0; k++ )	p[6][i+d*(j+d*k)] = true;
+    class[6] = 1;
+    piecemax[6] = 2+d*0+d*d*0;
+    for( i = 0; i <= 0; i++ )for( j = 0; j <= 2; j++ )for( k = 0; k <= 0; k++ )	p[7][i+d*(j+d*k)] = true;
+    class[7] = 1;
+    piecemax[7] = 0+d*2+d*d*0;
+    for( i = 0; i <= 0; i++ )for( j = 0; j <= 0; j++ )for( k = 0; k <= 2; k++ )	p[8][i+d*(j+d*k)] = true;
+    class[8] = 1;
+    piecemax[8] = 0+d*0+d*d*2;
+    for( i = 0; i <= 1; i++ )for( j = 0; j <= 1; j++ )for( k = 0; k <= 0; k++ )	p[9][i+d*(j+d*k)] = true;
+    class[9] = 2;
+    piecemax[9] = 1+d*1+d*d*0;
+    for( i = 0; i <= 1; i++ )for( j = 0; j <= 0; j++ )for( k = 0; k <= 1; k++ )	p[10][i+d*(j+d*k)] = true;
+    class[10] = 2;
+    piecemax[10] = 1+d*0+d*d*1;
+    for( i = 0; i <= 0; i++ )for( j = 0; j <= 1; j++ )for( k = 0; k <= 1; k++ )	p[11][i+d*(j+d*k)] = true;
+    class[11] = 2;
+    piecemax[11] = 0+d*1+d*d*1;
+    for( i = 0; i <= 1; i++ )for( j = 0; j <= 1; j++ )for( k = 0; k <= 1; k++ )	p[12][i+d*(j+d*k)] = true;
+    class[12] = 3;
+    piecemax[12] = 1+d*1+d*d*1;
+    piececount[0] = 13;
+    piececount[1] = 3;
+    piececount[2] = 1;
+    piececount[3] = 1;
+    m = 1+d*(1+d*1);
+    kount = 0;
+    if ( Fit(0, m) ) n = Place(0, m);
+    else printf("Error1 in Puzzle\n");
+    if ( ! Trial(n) ) printf ("Error2 in Puzzle.\n");
+    else if ( kount != 2005 ) printf ( "Error3 in Puzzle.\n");
+	 printf("%d\n", n);
+	 printf("%d\n", kount);
+}
+
+int main()
+{
+	int i;
+	for (i = 0; i < 100; i++) Puzzle();
+	return 0;
+}

File benchmark/Stanford/Puzzle.reference_output

+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+77
+2005
+exit 0

File benchmark/Stanford/Queens.c

+#include <stdio.h>
+#include <stdlib.h>
+
+#define  nil		0
+#define	 false		0
+#define  true		1
+#define  bubblebase	1.61f
+#define  dnfbase 	3.5f
+#define  permbase 	1.75f
+#define  queensbase 1.83f
+#define  towersbase 2.39f
+#define  quickbase 	1.92f
+#define  intmmbase 	1.46f
+#define  treebase 	2.5f
+#define  mmbase 	0.0f
+#define  fpmmbase 	2.92f
+#define  puzzlebase	0.5f
+#define  fftbase 	0.0f
+#define  fpfftbase 	4.44f
+    /* Towers */
+#define maxcells 	 18
+
+    /* Intmm, Mm */
+#define rowsize 	 40
+
+    /* Puzzle */
+#define size	 	 511
+#define classmax 	 3
+#define typemax 	 12
+#define d 		     8
+
+    /* Bubble, Quick */
+#define sortelements 5000
+#define srtelements  500
+
+    /* fft */
+#define fftsize 	 256 
+#define fftsize2 	 129  
+/*
+type */
+    /* Perm */
+#define permrange     10
+
+   /* tree */
+struct node {
+	struct node *left,*right;
+	int val;
+};
+
+    /* Towers */ /*
+    discsizrange = 1..maxcells; */
+#define    stackrange	3
+/*    cellcursor = 0..maxcells; */
+struct    element {
+	int discsize;
+	int next;
+};
+/*    emsgtype = packed array[1..15] of char;
+*/
+    /* Intmm, Mm */ /*
+    index = 1 .. rowsize;
+    intmatrix = array [index,index] of integer;
+    realmatrix = array [index,index] of real;
+*/
+    /* Puzzle */ /*
+    piececlass = 0..classmax;
+    piecetype = 0..typemax;
+    position = 0..size;
+*/
+    /* Bubble, Quick */ /*
+    listsize = 0..sortelements;
+    sortarray = array [listsize] of integer;
+*/
+    /* FFT */
+struct    complex { float rp, ip; } ;
+/*
+    carray = array [1..fftsize] of complex ;
+    c2array = array [1..fftsize2] of complex ;
+*/
+
+float value, fixed, floated;
+
+    /* global */
+long    seed;  /* converted to long for 16 bit WR*/
+
+    /* Perm */
+int    permarray[permrange+1];
+/* converted pctr to unsigned int for 16 bit WR*/
+unsigned int    pctr;
+
+    /* tree */
+struct node *tree;
+
+    /* Towers */
+int	   stack[stackrange+1];
+struct element    cellspace[maxcells+1];
+int    freelist,  movesdone;
+
+    /* Intmm, Mm */
+
+int   ima[rowsize+1][rowsize+1], imb[rowsize+1][rowsize+1], imr[rowsize+1][rowsize+1];
+float rma[rowsize+1][rowsize+1], rmb[rowsize+1][rowsize+1], rmr[rowsize+1][rowsize+1];
+
+    /* Puzzle */
+int	piececount[classmax+1],	class[typemax+1], piecemax[typemax+1];
+int	puzzl[size+1], p[typemax+1][size+1], n, kount;
+
+    /* Bubble, Quick */
+int sortlist[sortelements+1], biggest, littlest, top;
+
+    /* FFT */
+struct complex    z[fftsize+1], w[fftsize+1], e[fftsize2+1];
+float    zr, zi;
+
+void Initrand () {
+    seed = 74755L;   /* constant to long WR*/
+}
+
+int Rand () {
+    seed = (seed * 1309L + 13849L) & 65535L;  /* constants to long WR*/
+    return( (int)seed );     /* typecast back to int WR*/
+}
+
+
+    /* The eight queens problem, solved 50 times. */
+/*
+	type    
+	    doubleboard =   2..16;
+	    doublenorm  =   -7..7;
+	    boardrange  =   1..8;
+	    aarray      =   array [boardrange] of boolean;
+	    barray      =   array [doubleboard] of boolean;
+	    carray      =   array [doublenorm] of boolean;
+	    xarray      =   array [boardrange] of boardrange;
+*/
+
+void Try(int i, int *q, int a[], int b[], int c[], int x[]) {
+	int     j;
+	j = 0;
+	*q = false;
+	while ( (! *q) && (j != 8) ) {
+		j = j + 1;
+		*q = false;
+		if ( b[j] && a[i+j] && c[i-j+7] ) {
+			x[i] = j;
+		    b[j] = false;
+		    a[i+j] = false;
+		    c[i-j+7] = false;
+		    if ( i < 8 ) {
+		    	Try(i+1,q,a,b,c,x);
+				if ( ! *q ) {
+					b[j] = true;
+				    a[i+j] = true;
+				    c[i-j+7] = true;
+				}
+			}
+		    else *q = true;
+	    }
+	}
+}
+	
+void Doit () {
+	int i,q;
+	int a[9], b[17], c[15], x[9];
+	i = 0 - 7;
+	while ( i <= 16 ) {
+		if ( (i >= 1) && (i <= 8) ) a[i] = true;
+	    if ( i >= 2 ) b[i] = true;
+	    if ( i <= 7 ) c[i+7] = true;
+	    i = i + 1;
+	}
+
+	Try(1, &q, b, a, c, x);
+	if ( !q ) printf (" Error in Queens.\n");
+}
+
+void Queens (int run) {
+    int i;
+    for ( i = 1; i <= 50; i++ ) Doit();
+	 printf("%d\n", run + 1);
+}
+
+int main()
+{
+	int i;
+	for (i = 0; i < 100; i++) Queens(i);
+	return 0;
+}

File benchmark/Stanford/Queens.reference_output

+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42