Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 1996 02:04:17 +0400 (MSD)
From:      =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) <ache@nagual.ru>
To:        terry@lambert.org (Terry Lambert)
Cc:        joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@freebsd.org, current@freebsd.org
Subject:   Re: I plan to change random() for -current (was Re: rand() and random())
Message-ID:  <199610052204.CAA07197@nagual.ru>
In-Reply-To: <199610052053.NAA11278@phaeton.artisoft.com> from "Terry Lambert" at "Oct 5, 96 01:53:11 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> There is a historical dependence of much physics code on the
> repeatability of identical seeding for the linear congruential
> generator as a "randomness" base for repeatable Monte Carlo based
> testing of relativistically invariant P-P, N-P, and N-N pair production
> collisions.

The fix _not_ breaks repeatability of identical seeding.

> If you *do* change the random algorithms, then you should *leave the
> rand48() code along*.  I can not stress this enough.  You will damage
> repeatability of experiments for which source code is unavailable, and
> only the results remain.

I don't understand your statement well, random() already have different
implementations in different OSes. If you mean that previous FreeBSD
dynamic-linked binaries can produce different results, yes, it is
any upgrade cost. Make static binaries if source code is unavailable.

Depending on predictable system function results which claimed to
be 'random' is bad idea in general (and mans/docs/standards
not declare such possibility too). They only say that "this function
[not all possible versions of this function]
gives the same sequence for the same seed". Real practice when
rand() and random() functions changes between different OSes
and inside one OS too confirms it. I remember that Unix v6 rand()
was different with what we have currently, so we must return
to Unix v6 variant according to your logic.

-- 
Andrey A. Chernov
<ache@nagual.ru>
http://www.nagual.ru/~ache/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610052204.CAA07197>