Has anyone ported the PCG PRNG to FreeBASIC

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

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby deltarho[1859] » Sep 04, 2017 23:04

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: 530
Joined: Jan 02, 2017 0:34
Location: UK

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby deltarho[1859] » Sep 04, 2017 23:14

@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: 49
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby jj2007 » Sep 04, 2017 23:47

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: 49
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby jj2007 » Sep 05, 2017 0:09

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: 224
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby Provoni » Sep 05, 2017 7:32

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: 530
Joined: Jan 02, 2017 0:34
Location: UK

Re: Has anyone ported the PCG PRNG to FreeBASIC

Postby deltarho[1859] » Sep 05, 2017 15:15

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>

Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests