From kde-commits Tue Mar 31 21:55:06 2009 From: "Matthew Woehlke" Date: Tue, 31 Mar 2009 21:55:06 +0000 To: kde-commits Subject: RE: koffice/krita/image Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=123853656532656 Bah. /me grumbles something about d->'s. Sorry. -- Matthew -----Original Message----- From: Boudewijn Rempt [mailto:boud@valdyas.org] Sent: Tuesday, March 31, 2009 13:52 To: kde-commits@kde.org; Matthew Woehlke Subject: Re: koffice/krita/image On Tuesday 31 March 2009, Matthew Woehlke wrote: > SVN commit 947541 by mwoehlke: > > Modest changes to the PRNG algorithm. > > This gives better high-order bits (there was still some patterning in > the top-most bits) but shouldn't change the distribution > charasteristics otherwise. After much work, this version gets my > official seal of approval :-). > And does the unittest pass now? > > M +4 -4 kis_random_generator.cc > > > --- trunk/koffice/krita/image/kis_random_generator.cc #947540:947541 > @@ -62,13 +62,13 @@ > > // Generate salts > quint64 n1 = (quint64(x + 5) * kxa) * d->seed; > - quint64 n2 = (quint64(y + 7) * kya) + d->seed; > + quint64 n2 = (quint64(y + 7) * kya) + (d->seed * > + 1040097393733LL); > n1 = permuteWhole(n1, 8759824322359LL, 13); > + n2 = permuteWhole(n2, 200560490131LL, 2707); > n1 = (n1 >> 32) ^ (n1 << 32); > - n2 = permuteWhole(n2, 200560490131LL, 2707); > n2 = (n2 >> 32) ^ (n2 << 32); > - n1 ^= x ^ (y * 1040097393733LL) ^ kxb; > - n2 ^= y ^ (x * 1040097393733LL) ^ kyb; > + n1 ^= x ^ (quint64(y ^ seed) * kyb); > + n2 ^= y ^ (quint64(x + 13) * kxb); > > // Combine salts > quint64 v = 0; -- Boudewijn Rempt | http://www.valdyas.org