Re: [Bug-apl] Bad quality of the roll function

2014-08-22 Thread Juergen Sauermann
Hi Kacper, thanks a lot, included in SVN 442. /// Jürgen On 08/22/2014 12:03 AM, Kacper Gutowski wrote: I don't think there is anything to gain by changing the main LCG part given the constraints. I don't know how go

Re: [Bug-apl] Bad quality of the roll function

2014-08-21 Thread Kacper Gutowski
Oh, I see you already fixed the bias exatly the way I wanted you to in r440 even before I posted that :) I still recommend using xorshift premutation instead of bit reversal and iterating ⎕RL only once per output value. -k

Re: [Bug-apl] Bad quality of the roll function

2014-08-21 Thread Kacper Gutowski
I don't think there is anything to gain by changing the main LCG part given the constraints. I don't know how good are the parameters used by GNU APL but they should be okay since those are the ones proposed by Knuth. LCGs have a number of well known weaknesses, one of which is that their less si

Re: [Bug-apl] Bad quality of the roll function

2014-08-20 Thread Juergen Sauermann
Hi Blake, I did in the past. Problem is this: the normal random allows you to set the seed (srandom()) but not to retrieve it. However retrieving the seed is necessary to localize ⎕RL. I then look into the other method of random() to set the seed (i

Re: [Bug-apl] Bad quality of the roll function

2014-08-20 Thread Blake McBride
Why not use random(3) (or are you)? Thanks. Blake On Wed, Aug 20, 2014 at 9:07 AM, Juergen Sauermann < juergen.sauerm...@t-online.de> wrote: > Hi Kacper, > > thanks for reporting this. Should be improved in SVN 439. > > /// Jürgen > > > > On 08/20/2014 06:47 AM, Kacper Gutowski wrote: > >> Cu

Re: [Bug-apl] Bad quality of the roll function

2014-08-20 Thread Juergen Sauermann
Hi Kacper, thanks for reporting this. Should be improved in SVN 439. /// Jürgen On 08/20/2014 06:47 AM, Kacper Gutowski wrote: Currently GNU APL uses LCG with modulus 2⋆64 and then reduces values modulo desired range. This, beside being slightly biased for ranges not dividing the modulus, yi

[Bug-apl] Bad quality of the roll function

2014-08-19 Thread Kacper Gutowski
Currently GNU APL uses LCG with modulus 2⋆64 and then reduces values modulo desired range. This, beside being slightly biased for ranges not dividing the modulus, yields reduced periods when range is power of two. ?10 16⍴16 11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8 11 2 13 12 15 6 1 16 3 10 5