POV-Ray : Newsgroups : povray.general : Requesting ideas/opinions for RNG seeding syntax : Re: Requesting ideas/opinions for RNG seeding syntax Server Time
30 Jul 2024 22:16:47 EDT (-0400)
  Re: Requesting ideas/opinions for RNG seeding syntax  
From: Warp
Date: 23 May 2009 16:13:43
Message: <4a1858f5@news.povray.org>
Phoenex <rib### [at] sapopt> wrote:
> This algorithm is not a basic LCG.
> If you Check carefully the tests, you can not find weaknesses or shortcomings.

  Unless someone explains in more detail how it's different from a basic
LCG, I can't see why it's different. It's doing the basic LCG formula:

seed = (seed*a + b) mod 1.0

with a value of 0.0 for b (which is interesting, but doesn't really
differentiate it much from a basic LCG).

  I wonder if the "quality" of this RNG is not simply caused by its
typical usage: The highest bits of the result are used, rather than
the lowest bits, which is a rather common mistake on integral LCGs.

> In addition it is very, but very fast.

  It might be pretty fast if you want to generate random floating point
numbers in the range [0.0, 1.0]. It beats integral RNGs in that with
them you have to perform a floating point division to scale them to the
[0.0, 1.0] range, which is slow.

  OTOH, it wouldn't be very fast to generate integer random numbers.

  The remaining question would be the quality of the randomness.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.