Skip to content

Commit

Permalink
Update docs and recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Jan 30, 2025
1 parent c6bc559 commit 2567f7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 6 additions & 3 deletions doc/generator_defs.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
[template ranlux64_4_01_speed[] 2%]
[template mt19937ar_c_speed[] 97%]
[template splitmix64_speed[] 155%]
[template xoshiro256pp_speed[] 90%]
[template xoshiro256d_speed[] 101%]
[template xoshiro256mm_speed[] 82%]
[template xoshiro256pp_speed[] 132%]
[template xoshiro256d_speed[] 139%]
[template xoshiro256mm_speed[] 116%]
[template xoshiro512pp_speed[] 133%]
[template xoshiro512d_speed[] 144%]
[template xoshiro512mm_speed[] 113%]
7 changes: 5 additions & 2 deletions doc/generators.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ numbers mean faster random number generation.
[[__xoshiro256pp] [2[sup 256] [`4*sizeof(uint64_t)`] [[xoshiro256pp_speed]] [[xoshiro256++ from https://prng.di.unimi.it]]
[[__xoshiro256d] [2[sup 256] [`4*sizeof(uint64_t)`] [[xoshiro256d_speed]] [[This generator returns doubles instead of uint64_t. It is modified xoshiro256+ from https://prng.di.unimi.it]]
[[__xoshiro256mm] [2[sup 256] [`4*sizeof(uint64_t)`] [[xoshiro256mm_speed]] [[xoshiro256** from https://prng.di.unimi.it]]
[[__xoshiro512pp] [2[sup 512] [`8*sizeof(uint64_t)`] [[xoshiro512pp_speed]] [[xoshiro512++ from https://prng.di.unimi.it]]
[[__xoshiro512d] [2[sup 512] [`8*sizeof(uint64_t)`] [[xoshiro512d_speed]] [[This generator returns doubles instead of uint64_t. It is modified xoshiro512+ from https://prng.di.unimi.it]]
[[__xoshiro512mm] [2[sup 512] [`8*sizeof(uint64_t)`] [[xoshiro512mm_speed]] [[xoshiro512** from https://prng.di.unimi.it]]
]

As observable from the table, there is generally a quality/performance/memory
Expand All @@ -98,8 +101,8 @@ generators for a given application of Monte Carlo simulation will improve
the confidence in the results.

If the names of the generators don't ring any bell and you have no idea
which generator to use, it is reasonable to employ __mt19937 for a start: It
is fast and has acceptable quality.
which generator to use, it is reasonable to employ __xoshiro256pp for a start: It
is fast and of high quality.

[note These random number generators are not intended for use in applications
where non-deterministic random numbers are required. See __random_device
Expand Down
3 changes: 3 additions & 0 deletions performance/random_speed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ int main(int argc, char*argv[])
run(iter, "xoshiro256pp", boost::random::xoshiro256pp());
run(iter, "xoshiro256d", boost::random::xoshiro256d());
run(iter, "xoshiro256mm", boost::random::xoshiro256mm());
run(iter, "xoshiro512pp", boost::random::xoshiro512pp());
run(iter, "xoshiro512d", boost::random::xoshiro512d());
run(iter, "xoshiro512mm", boost::random::xoshiro512mm());

#ifdef HAVE_MT19937INT_C
// requires the original mt19937int.c
Expand Down

0 comments on commit 2567f7f

Please sign in to comment.