22nd test

This commit is contained in:
kuntz 2021-02-06 20:17:59 -06:00
parent 38b000d40e
commit 1021979596
2 changed files with 15 additions and 5 deletions

View File

@ -2,8 +2,8 @@
// Copyright © 2021 by Brett Kuntz. All rights reserved.
//----------------------------------------------------------------------------------------------------------------------
#include "compress.h"
#define CUTS_LENGTH 17
static ui CHAIN_CUTS[CUTS_LENGTH] = { 37, 23, 17, 14, 11, 9, 8, 7, 6, 6, 5, 5, 5, 4, 4, 4, -1 };
#define CUTS_LENGTH 21
static ui CHAIN_CUTS[CUTS_LENGTH] = { 37, 23, 17, 14, 11, 9, 8, 7, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 3, -1 };
//----------------------------------------------------------------------------------------------------------------------
//#include <windows.h>
si main(si argc, s8 ** argv)
@ -62,7 +62,7 @@ si main(si argc, s8 ** argv)
if (*global_total != 0) // fixes rare fork() emulation bug
{
s8 buf[2048];
s8 buf[4096];
const r64 avg_distance = (r64)*global_total / SAMPLES;
sprintf(buf, "Test Params: ");
for (ui i=0;i<CUTS_LENGTH;i++)
@ -71,7 +71,7 @@ si main(si argc, s8 ** argv)
}
buf[strlen(buf) - 2] = 0;
sprintf(&buf[strlen(buf)], "\nn=%lu\n", SAMPLES);
sprintf(&buf[strlen(buf)], "Average Distance: %.4f\n\n", avg_distance);
sprintf(&buf[strlen(buf)], "Average Distance: %.8f\n\n", avg_distance);
FILE * fout = fopen("output_results.txt", "ab");
fputs(buf, fout);
fclose(fout);
@ -86,6 +86,12 @@ static void check(void)
{
FILE * frand = fopen("/dev/urandom", "rb");
if (!frand)
{
printf("/dev/urandom error\n");
exit(EXIT_FAILURE);
}
u64 total = 0;
const u64 start = tick();

View File

@ -36,7 +36,11 @@ typedef float r32 ; typedef double r64 ;
// 15th cut is 4
// 16th cut is 4
// 17th cut is 4
// 18th cut is ??
// 18th cut is 3
// 19th cut is 3
// 20th cut is 3
// 21st cut is 3
// 22nd cut is ???
#include <stdio.h>
#include <stdlib.h>
#include <string.h>