Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91361 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67654 invoked from network); 23 Feb 2016 14:50:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2016 14:50:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thefsb.org designates 173.203.187.83 as permitted sender) X-PHP-List-Original-Sender: fsb@thefsb.org X-Host-Fingerprint: 173.203.187.83 smtp83.iad3a.emailsrvr.com Linux 2.6 Received: from [173.203.187.83] ([173.203.187.83:55479] helo=smtp83.iad3a.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/04-38634-9A17CC65 for ; Tue, 23 Feb 2016 09:50:18 -0500 Received: from smtp27.relay.iad3a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp27.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id B639918024C; Tue, 23 Feb 2016 09:50:14 -0500 (EST) X-Auth-ID: fsb@thefsb.org Received: by smtp27.relay.iad3a.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 9235B18040D; Tue, 23 Feb 2016 09:50:14 -0500 (EST) X-Sender-Id: fsb@thefsb.org Received: from yossy.local (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.5.4); Tue, 23 Feb 2016 09:50:14 -0500 To: Yasuo Ohgaki References: Cc: "internals@lists.php.net" Message-ID: <56CC71A0.3060306@thefsb.org> Date: Tue, 23 Feb 2016 09:50:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: PRNG: Raise warning and/or provide better pseudorandom generator? From: fsb@thefsb.org (Tom Worster) I agree that mt_rand() should warn before delivering bogus outputs. But when it works, it works ok: https://gist.github.com/tom--/a12175047578b3ae9ef8 Given that it hasn't been MT19937 or many years, it probably doesn't need to be. If there is really a need for fast repeatable RNGs (the kind popular in monte-carlo sims) then MT is no longer the most likely candidate. A new API could allow the user to select a generator -- there are a lot to chose from (see below)! Tom These are the built-in generators in dieharder 3.31.1. Note the xorshift family isn't present. Melissa O’'Neill's new PCG family is interesting too. 000 borosh13 001 cmrg 002 coveyou 003 fishman18 004 fishman20 005 fishman2x 006 gfsr4 007 knuthran 008 knuthran2 009 knuthran2002 010 lecuyer21 011 minstd 012 mrg 013 mt19937 014 mt19937_1999 015 mt19937_1998 016 r250 017 ran0 018 ran1 019 ran2 020 ran3 021 rand 022 rand48 023 random128-bsd 024 random128-glibc2 025 random128-libc5 026 random256-bsd 027 random256-glibc2 028 random256-libc5 029 random32-bsd 030 random32-glibc2 031 random32-libc5 032 random64-bsd 033 random64-glibc2 034 random64-libc5 035 random8-bsd 036 random8-glibc2 037 random8-libc5 038 random-bsd 039 random-glibc2 040 random-libc5 041 randu 042 ranf 043 ranlux 044 ranlux389 045 ranlxd1 046 ranlxd2 047 ranlxs0 048 ranlxs1 049 ranlxs2 050 ranmar 051 slatec 052 taus 053 taus2 054 taus113 055 transputer 056 tt800 057 uni 058 uni32 059 vax 060 waterman14 061 zuf 203 ca 204 uvag 205 AES_OFB 206 Threefish_OFB 207 XOR (supergenerator) 208 kiss 209 superkiss 400 R_wichmann_hill 401 R_marsaglia_multic. 402 R_super_duper 403 R_mersenne_twister 404 R_knuth_taocp 405 R_knuth_taocp2