All Questions
Tagged with c random-number-generation
5 questions
6
votes
3
answers
2k
views
How good are current implementations of rand() in C?
There is a lot of literature that indicates using rand() for simulations might be harmful. A couple of them are as follows:
https://www.sciencedirect.com/science/...
2
votes
1
answer
190
views
What PRNG function is this?
This is a 16-bit PRNG function, transcribed from assembly to C for easier reading:
...
1
vote
1
answer
110
views
PETCs - How should one initialize PetscRandom?
The documentation of PETSc shows an example of usage:
...
1
vote
2
answers
106
views
Maintain Uniform Distribution across Subranges
Note: this is a continuation of Generate Random Number outside Bounds.
I have a function (thanks to the previous question) with the following prototype which returns an integer in the range $[0,b]$, $...
8
votes
1
answer
517
views
WELL pseudo-random number generations
I've used MT19937 in a test harness to generate uniformly (unsigned) 32-bit [0, $2^{32}$- 1] values, based on the original Authors' mt19937.c implementation, to ...