4 ms·
A quick test with C++'s <random> library agrees. For n = 100,000,000 points, the rejection method beat out the improved spherical by 7.8%. Using the normal dist
by cs_ 8y ago
A quick test with C++'s <random> library agrees. For n = 100,000,000 points, the rejection method beat out the improved spherical by 7.8%. Using the normal distribution was even slower.
XYZ: 16.418057 seconds
Gauss: 23.415560 seconds
Spherical: 17.705553 seconds
- charmides 8y agoThose results are surprisingly close.
- dmurray 8y agoYoull get a different result if random number generation is made more expensive, e.g. if you need to use a hardware RNG instead of a PRNG.
- blattimwind 8y agoBut why would you do that?