From owner-freebsd-hackers Sat Oct 5 15:16:03 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA11775 for hackers-outgoing; Sat, 5 Oct 1996 15:16:03 -0700 (PDT) Received: from sovcom.kiae.su (sovcom.kiae.su [193.125.152.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA11608; Sat, 5 Oct 1996 15:13:15 -0700 (PDT) Received: by sovcom.kiae.su id AA26728 (5.65.kiae-1 ); Sun, 6 Oct 1996 01:05:22 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Sun, 6 Oct 96 01:05:22 +0300 Received: (from ache@localhost) by nagual.ru (8.7.6/8.7.3) id CAA07197; Sun, 6 Oct 1996 02:04:17 +0400 (MSD) Message-Id: <199610052204.CAA07197@nagual.ru> Subject: Re: I plan to change random() for -current (was Re: rand() and random()) In-Reply-To: <199610052053.NAA11278@phaeton.artisoft.com> from "Terry Lambert" at "Oct 5, 96 01:53:11 pm" To: terry@lambert.org (Terry Lambert) Date: Sun, 6 Oct 1996 02:04:17 +0400 (MSD) Cc: joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@freebsd.org, current@freebsd.org From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) Organization: self X-Class: Fast X-Mailer: ELM [version 2.4ME+ PL28 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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 http://www.nagual.ru/~ache/