Index: tests/PRNG.cfa
===================================================================
--- tests/PRNG.cfa	(revision ae7a085c8585b48815059235b608cbf4791dd8e5)
+++ tests/PRNG.cfa	(revision 8a2f7f1912f623e4fbf43c521715fa48f403beb5)
@@ -8,6 +8,6 @@
 // Created On       : Wed Dec 29 09:38:12 2021
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Dec 21 20:39:59 2022
-// Update Count     : 406
+// Last Modified On : Sat Apr 15 16:44:31 2023
+// Update Count     : 419
 // 
 
@@ -15,16 +15,21 @@
 #include <stdlib.hfa>									// PRNG
 #include <clock.hfa>
-#include <thread.hfa>
 #include <limits.hfa>									// MAX
 #include <math.hfa>										// sqrt
 #include <malloc.h>										// malloc_stats
 #include <locale.h>										// setlocale
+#include <thread.hfa>
 #include <mutex_stmt.hfa>
 
-#ifdef __x86_64__										// 64-bit architecture
+#define xstr(s) str(s)
+#define str(s) #s
+
+#if defined( __x86_64__ ) || defined( __aarch64__ )		// 64-bit architecture
 #define PRNG PRNG64
 #else													// 32-bit architecture
 #define PRNG PRNG32
 #endif // __x86_64__
+
+//#define TIME
 
 #ifdef TIME												// use -O2 -nodebug
@@ -38,6 +43,6 @@
 #endif // TIME
 
-void avgstd( unsigned int buckets[] ) {
-	unsigned int min = MAX, max = 0;
+static void avgstd( size_t trials, size_t buckets[] ) {
+	size_t min = MAX, max = 0;
 	double sum = 0.0, diff;
 	for ( i; BUCKETS ) {
@@ -54,5 +59,5 @@
 	} // for
 	double std = sqrt( sum / BUCKETS );
-	mutex( sout ) sout | "trials"  | TRIALS | "buckets" | BUCKETS
+	mutex( sout ) sout | "trials"  | trials | "buckets" | BUCKETS
 		| "min" | min | "max" | max
 		| "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%";
@@ -64,9 +69,9 @@
 thread T1 {};
 void main( T1 & ) {
-	unsigned int * buckets = calloc( BUCKETS );			// too big for task stack
-	for ( TRIALS / 100 ) {
+	size_t * buckets = calloc( BUCKETS );				// too big for task stack
+	for ( TRIALS / 50 ) {
 		buckets[rand() % BUCKETS] += 1;					// concurrent
 	} // for
-	avgstd( buckets );
+	avgstd( TRIALS / 50, buckets );
 	free( buckets );
 } // main
@@ -76,9 +81,9 @@
 	PRNG prng;
 	if ( seed != 0 ) set_seed( prng, seed );
-	unsigned int * buckets = calloc( BUCKETS );			// too big for task stack
+	size_t * buckets = calloc( BUCKETS );				// too big for task stack
 	for ( TRIALS ) {
 		buckets[prng( prng ) % BUCKETS] += 1;			// concurrent
 	} // for
-	avgstd( buckets );
+	avgstd( TRIALS, buckets );
 	free( buckets );
 } // main
@@ -86,9 +91,9 @@
 thread T3 {};
 void main( T3 & th ) {
-	unsigned int * buckets = calloc( BUCKETS );			// too big for task stack
-	for ( TRIALS ) {
+	size_t * buckets = calloc( BUCKETS );				// too big for task stack
+	for ( TRIALS / 5 ) {
 		buckets[prng() % BUCKETS] += 1;					// concurrent
 	} // for
-	avgstd( buckets );
+	avgstd( TRIALS / 5, buckets );
 	free( buckets );
 } // main
@@ -96,9 +101,9 @@
 thread T4 {};
 void main( T4 & th ) {
-	unsigned int * buckets = calloc( BUCKETS );			// too big for task stack
+	size_t * buckets = calloc( BUCKETS );				// too big for task stack
 	for ( TRIALS ) {
-		buckets[prng( th ) % BUCKETS] += 1;	// concurrent
-	} // for
-	avgstd( buckets );
+		buckets[prng( th ) % BUCKETS] += 1;				// concurrent
+	} // for
+	avgstd( TRIALS, buckets );
 	free( buckets );
 } // main
@@ -108,9 +113,9 @@
 static void dummy( thread$ & th ) __attribute__(( noinline ));
 static void dummy( thread$ & th ) {
-	unsigned int * buckets = (unsigned int *)calloc( BUCKETS, sizeof(unsigned int) ); // too big for task stack
-	for ( unsigned int i = 0; i < TRIALS; i += 1 ) {
+	size_t * buckets = (size_t *)calloc( BUCKETS, sizeof(size_t) ); // too big for task stack
+	for ( size_t i = 0; i < TRIALS; i += 1 ) {
 		buckets[prng( th ) % BUCKETS] += 1;				// sequential
 	} // for
-	avgstd( buckets );
+	avgstd( TRIALS, buckets );
 	free( buckets );
 } // dummy
@@ -126,7 +131,10 @@
 	enum { TASKS = 4 };
 	Time start;
+
 #ifdef TIME												// too slow for test and generates non-repeatable results
 #if 1
-	unsigned int rseed;
+	sout | "glib rand" | nl | nl;
+
+	size_t rseed;
 	if ( seed != 0 ) rseed = seed;
 	else rseed = rdtscl();
@@ -134,5 +142,5 @@
 
 	sout | sepDisable;
-	sout | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
+	sout | nl | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
 	for ( 20 ) {
 		sout | wd(26, rand()) | nonl;
@@ -146,12 +154,12 @@
 	STARTTIME;
 	{
-		unsigned int * buckets = calloc( BUCKETS );		// too big for task stack
-		for ( i; TRIALS / 10 ) {
+		size_t * buckets = calloc( BUCKETS );			// too big for task stack
+		for ( i; TRIALS / 5 ) {
 			buckets[rand() % BUCKETS] += 1;				// sequential
 		} // for
-		avgstd( buckets );
+		avgstd( TRIALS / 5, buckets );
 		free( buckets );
 	}
-	ENDTIME( " x 10 " );
+	ENDTIME( " x 5 " );
 
 	sout | nl | "Concurrent";
@@ -163,7 +171,10 @@
 		} // wait for threads to complete
 	}
-	ENDTIME( " x 100 " );
+	ENDTIME( " x 50 " );
 #endif // 0
 #endif // TIME
+
+	sout | nl | "CFA " xstr(PRNG_NAME);
+
 #if 1
 	PRNG prng;
@@ -184,9 +195,9 @@
 	STARTTIME;
 	{
-		unsigned int * buckets = calloc( BUCKETS );		// too big for task stack
+		size_t * buckets = calloc( BUCKETS );			// too big for task stack
 		for ( TRIALS ) {
 			buckets[prng( prng ) % BUCKETS] += 1;		// sequential
 		} // for
-		avgstd( buckets );
+		avgstd( TRIALS, buckets );
 		free( buckets );
 	}
@@ -219,12 +230,12 @@
 	STARTTIME;
 	{
-		unsigned int * buckets = calloc( BUCKETS );		// too big for task stack
-		for ( TRIALS ) {
+		size_t * buckets = calloc( BUCKETS );			// too big for task stack
+		for ( TRIALS / 5 ) {
 			buckets[prng() % BUCKETS] += 1;
 		} // for
-		avgstd( buckets );
+		avgstd( TRIALS / 5, buckets );
 		free( buckets );
 	}
-	ENDTIME();
+	ENDTIME( " x 5 " );
 
 	sout | nl | "Concurrent";
@@ -236,5 +247,5 @@
 		} // wait for threads to complete
 	}
-	ENDTIME();
+	ENDTIME( " x 5 " );
 #endif // 0
 #if 1
