From bug-request at octave dot org Wed Jul 28 10:27:01 2004 Subject: Re: problem with rand ? From: David Bateman To: "Dmitri A. Sergatskov" Cc: bug at octave dot org Date: Wed, 28 Jul 2004 17:23:06 +0200 According to Dmitri A. Sergatskov (on 07/28/04): > David Bateman wrote: > ... > > > > >You are welcome to make any modifications you like and make eitehr 32 > >or 53-bit the default. > > > > ... > > Another option is to have both fast and high-precision versions > together (e.g. rand and rand32 or rand and frand)... The preferred solution for rand is to try and get it as fast as the matlab version with 53-bits as they use exactly the same technique. There is probably some code optimization to be done to get it a little faster (need about 26% speed-up). For the randn code the problem is difference as randn uses a shorter cycle generator than the Mersenne Twister. So unless we want to sacrifice the cycle length, we can't get both the same speed and 53-bits. If the base Mersenne Twister algorithm was about 26% faster then randn would then only be about 30% slower than the matlab version. Frankly I'd consider than a reasonable price to pay for the cycle length of the Mersenne Twister, and in that case I'd be all for 53-bits everywhere, and forget about having two versions. Cheers David -- David Bateman David dot Bateman at motorola dot com Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------