Has anyone ported the PCG PRNG to FreeBASIC

General FreeBASIC programming questions.
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by deltarho[1859] »

PractRand 0.92
jj2007 wrote:With ENT, pcg looks good but not exceptionally good.
Masses amounts of data need to be examined to draw meaningfull conclusions. ENT is not designed for that and may give a less than favourable report for quantum random numbers. PractRand looked at up to one terabyte of pcg data and the results were fine. Mersenne Twister fails at 256GB and xoroshiro128+ fails at 64GB.
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by deltarho[1859] »

@srvaldez

Got a notification of your post after my posting. So, why did I not see your post? I was put onto a new page for mine. <laugh>
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by jj2007 »

deltarho[1859] wrote:PractRand 0.92
Thanks a lot. Unfortunately, it throws exceptions, randomly ;-)

In the meantime, I managed to build the exe from the 0.93 zip file. VS 2010 threw many errors, but VS Community (after the coffee break...) builds it. Both your and my version work fine, occasionally, on a 16MB file, on other occasions they throw access violation exceptions reading the same file. Oh well.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by jj2007 »

jj2007 wrote:
deltarho[1859] wrote:PractRand 0.92
Thanks a lot. Unfortunately, it throws exceptions, randomly ;-)

In the meantime, I managed to build the exe from the 0.93 zip file. VS 2010 threw many errors, but VS Community (after the coffee break...) builds it. Both your and my version work fine, occasionally, on a 16MB file, on other occasions they throw access violation exceptions reading the same file. Oh well. Could be wrong assumptions about the alignment of heap memory, ... could be anything. Too tired to investigate.
Provoni
Posts: 514
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by Provoni »

This rng is godsent. Thank you so much.

I am testing it with my program AZdecrypt, a fast multi-threaded homophonic substitution cipher solver which uses a stochastic hill climbing method. Better rng usually increases the performance of the solver and this is what happened, the solver is about 10% faster and the output slightly improved over the old rng.

The tests totalled about 10.000.000.000 random numbers.
deltarho[1859]
Posts: 4310
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Post by deltarho[1859] »

There is a guy at the PowerBASIC forum who almost invariably criticised everything that I did and implied that I was obsessed with the speed of random number generators. He reckoned that PB's RND was good enough. PB's RND has a 32 bit output, a 32 bit period and ticks over at about 80MHz.

I would have loved to cite your AZdecrypt, Provoni, because the last thing you want is a 'slow coach' generator and, in your case, a 32 bit period does not pass muster. PB's RND also fails a PractRand test at the first hurdle. The PB guy did not respond when I mentioned that sometime later, not surprisingly. <smile>
Post Reply