From owner-cvs-src Sun Feb 16 19:52:45 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58F7437B401; Sun, 16 Feb 2003 19:52:43 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82A1D43FE0; Sun, 16 Feb 2003 19:52:36 -0800 (PST) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h1H3qabv062672; Sun, 16 Feb 2003 19:52:36 -0800 (PST) (envelope-from ache@repoman.freebsd.org) Received: (from ache@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h1H3qawJ062671; Sun, 16 Feb 2003 19:52:36 -0800 (PST) Message-Id: <200302170352.h1H3qawJ062671@repoman.freebsd.org> From: "Andrey A. Chernov" Date: Sun, 16 Feb 2003 19:52:35 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc/stdlib rand.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ache 2003/02/16 19:52:35 PST Modified files: lib/libc/stdlib rand.c Log: Back out "drop first N values" method of removing monotonically increased seed->first value correlation. It breaks rand_r()... Other possible methods like shuffling inside aray will breaks rand_r() too, because it assumes only one word state, i.e. nothing extra can be added after seed assignment in srand(). BTW, for old formulae seed->first value correlation is not so monotonically increased as with other Linear Congruential Generators of this type only becase arithmetic overflow happens. But overflow affects distribution and lower bits very badly, as many articles says, such type of overflow not improves PRNG. So, monotonically increased seed->first value correlation problem remains... Revision Changes Path 1.15 +1 -7 src/lib/libc/stdlib/rand.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message