On Sun, Feb 16, 2003 at 20:57:29 -0800, Kris Kennaway wrote:
> On Sun, Feb 16, 2003 at 07:52:35PM -0800, Andrey A. Chernov wrote:
> 
> >   So, monotonically increased seed->first value correlation problem remains...
> 
> I think we should commit this patch (to -current) and fix all the
> problems that pop up.  For example, it's used in awk (which started
> this set of changes), and in some of the XFree86 libraries.

I agree. (diff is for old rand.c, but idea is clear in anycase).

I have no fancy ideas how to fix correlation problem AND keep rand_r()
compatibility at the same time. All linear mod-type generators share this
problem with monotonic seeding and usual solution is shuffling array (more
complex code than I use), but it will be incompatible with rand_r() again.

If we back out most of changes and return to very first formulae with 
overflow, we
1) Make monotonic increasing for seed->first_value less visible.
2) Not fix seed->first_value correlation (taking some parts of bits
will show repeated pattern).
3) Make distribution and lower bits bad.

-- 
Andrey A. Chernov
http://ache.pp.ru/

Attachment: msg52528/pgp00000.pgp
Description: PGP signature

Reply via email to