|
From: | Michael Pender |
Subject: | Re: Rand implementation question |
Date: | Fri, 28 Feb 2014 15:00:19 -0500 |
# Function Attr Time (s) Calls
--------------------------------------------------------
21 randi 173.318 2179755
6 rand 16.941 2741950
in general, it's a bad idea to extract bitfields from a pseudo-random number generators (it's also famously bad to aggregate consecutive values, as shown by classic Marsaglia paper http://www.pnas.org/content/61/1/25.full.pdf)On 02/27/2014 10:04 PM, mpender wrote:
should be some efficient way to extract multiple bits from a single double-precision floating point value returned by the Mersenne twister.
Now, the Mersenne twister may not be subject to those problems, but one should refrain from using the generators in a way that they weren't designed or tested for. Hence, it's best to use randi() which just plain gives integers without any gymnastics.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |