Mersenne Twister giving bad uniform then bad Normal Distribution

I test the SDK examples Mersenne Twiste
If i compute the mean and standard deviation of the random number (N(0,1)) after the Box Muller, for example the first 4096 random numbers, i have a very poor mean 0.2 and a very poor std deviation 1.58, even with all the random numbers (2000000) the mean and std are not very well (0.0001 and 0.97…) (same problem with the OpenCL example)
However, if i take the mersenne twister SDK of AMD and i run it on my CPU (openCL example), the N(0,1) numbers are quite good compare to the SDK example of NVIDIA
It’s a problem of initialization of the data of the mersenne Twister algorithm.
Do you have a fix for this SDK examples ?

Same problem here.
Seems the seeds for initialization are somewhat slow to compute if you want them to be truly independant (that in the sdk seems to have been provided by matsumoto, but didn’t find how they were computed, even on his website).
Tried to plot the repartition of the first 60k points of the uniform part of that example, didn’t look really uniform to me. Some arrays between 0 and 1 are overrepresented, and you don’t need sophisticated tests to see that.
Your rng’s quality depends on what you want to do with. Big period doesn’t means good repartition for relatively short sequences. Didn’t find one with a good enough distribution for parallel monte carlo - double precision and around 1-2M paths ; and can’t precompute in serial and stock them - too big. Still looking for the Graal :unsure:
Did u try sobol and quasirandom suites ?

else, this one seems quite good, but didn’t test :…t&p=1087571

found that

Hi in fact i use Sobol and MT for the brownian bridge
I have improve MT with Warm-Up:
However, the Mersenne Twister in the SDK AMD for OpenCL is better that the NVIDIA one
Thanks a lot