comp.lang.ada
 help / color / mirror / Atom feed
* “A Comparison of Four Pseudo Random Number Generators Implemented in Ada”
@ 2013-07-19 19:28 Yannick Duchêne (Hibou57)
  2013-07-19 21:43 ` Shark8
  2013-07-19 22:07 ` ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada² Bill Findlay
  0 siblings, 2 replies; 5+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2013-07-19 19:28 UTC (permalink / raw)


I was searching the web for simple pseudo‑random number generator suitable  
for Monte Carlo simulation, when I found a paper comparing some PRNG  
implemented in Ada. Don't know if it well suited for simulation and  
“calculation” based on random input, but probably always worth to be  
mentioned here :-p

“A Comparison of Four Pseudo Random Number Generators Implemented in Ada”
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.7884&rep=rep1&type=pdf
William N. Graham
April 1999

Ada source is provided at the end of the document.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: “A Comparison of Four Pseudo Random Number Generators Implemented in Ada”
  2013-07-19 19:28 “A Comparison of Four Pseudo Random Number Generators Implemented in Ada” Yannick Duchêne (Hibou57)
@ 2013-07-19 21:43 ` Shark8
  2013-07-19 22:07 ` ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada² Bill Findlay
  1 sibling, 0 replies; 5+ messages in thread
From: Shark8 @ 2013-07-19 21:43 UTC (permalink / raw)


I recall a RNG that was posted [or posted about] here on Comp.Lang.Ada; here's a link to a thread:

https://groups.google.com/forum/?fromgroups#!searchin/comp.lang.ada/RNG/comp.lang.ada/Iy6J3UzDwVQ/fvVkxUQoRfoJ

It's name, if you need to search, was/is: KISS4691


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada²
  2013-07-19 19:28 “A Comparison of Four Pseudo Random Number Generators Implemented in Ada” Yannick Duchêne (Hibou57)
  2013-07-19 21:43 ` Shark8
@ 2013-07-19 22:07 ` Bill Findlay
  2013-07-20  0:18   ` Jeffrey Carter
  1 sibling, 1 reply; 5+ messages in thread
From: Bill Findlay @ 2013-07-19 22:07 UTC (permalink / raw)


On 19/07/2013 20:28, in article op.w0hhpusdule2fv@cardamome, "Yannick
Duchêne   (Hibou57)" <yannick_duchene@yahoo.fr> wrote:

> I was searching the web for simple pseudo‑random number generator suitable
> for Monte Carlo simulation, when I found a paper comparing some PRNG
> implemented in Ada. Don't know if it well suited for simulation and
> “calculation” based on random input, but probably always worth to be
> mentioned here :-p

Why not use Ada.Numerics.{Discrete,Float}_Random ?

-- 
Bill Findlay
with blueyonder.co.uk;
use  surname & forename;




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada²
  2013-07-19 22:07 ` ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada² Bill Findlay
@ 2013-07-20  0:18   ` Jeffrey Carter
  2013-07-20  0:41     ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Carter @ 2013-07-20  0:18 UTC (permalink / raw)


On 07/19/2013 03:07 PM, Bill Findlay wrote:
>
> Why not use Ada.Numerics.{Discrete,Float}_Random ?

Those are excellent when you don't care what sequence of values you get from the 
generator with different compilers or different platforms, but in those cases 
where you need to portably obtain the same sequence for the same seed value(s), 
you need to use something else.

-- 
Jeff Carter
"You a big nose have it."
Never Give a Sucker an Even Break
107


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada²
  2013-07-20  0:18   ` Jeffrey Carter
@ 2013-07-20  0:41     ` Yannick Duchêne (Hibou57)
  0 siblings, 0 replies; 5+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2013-07-20  0:41 UTC (permalink / raw)


Le Sat, 20 Jul 2013 02:18:38 +0200, Jeffrey Carter  
<spam.jrcarter.not@spam.not.acm.org> a écrit:

> On 07/19/2013 03:07 PM, Bill Findlay wrote:
>>
>> Why not use Ada.Numerics.{Discrete,Float}_Random ?
>
> Those are excellent when you don't care what sequence of values you get  
> from the generator with different compilers or different platforms, but  
> in those cases where you need to portably obtain the same sequence for  
> the same seed value(s), you need to use something else.

Also and more basically, it's often suggested to not rely on a single  
generator and use at least two ones, different enough, for comparison of  
results, as most papers about Monte Carlo methods introduces this. That's  
after all just like with hash functions.

You may also favour algorithms (either in mathematical or comprehensible  
source form) over libraries when, as you say, you want to be able to  
reproduce an exact same sequence without a record of it (may weight too  
much, easily some hundreds of MB), or else want the same in different  
contexts, say Ada and SML without external binding.

And above all, this paper mentions Ada and put it at the front, so that's  
a lot worthy anyway :-D


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-20  0:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 19:28 “A Comparison of Four Pseudo Random Number Generators Implemented in Ada” Yannick Duchêne (Hibou57)
2013-07-19 21:43 ` Shark8
2013-07-19 22:07 ` ³A Comparison of Four Pseudo Random Number Generators Implemented in Ada² Bill Findlay
2013-07-20  0:18   ` Jeffrey Carter
2013-07-20  0:41     ` Yannick Duchêne (Hibou57)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox