Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
R
ranlux-tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christoph Conrads
ranlux-tools
Commits
623bec77
Commit
623bec77
authored
Mar 26, 2019
by
Christoph Conrads
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README: briefly explain contents of repository
parent
00197987
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
README.md
README.md
+54
-3
No files found.
README.md
View file @
623bec77
# R
anlux
Tools
# R
ANLUX
Tools
This git repository contains programs helping with the creation of Ranlux
pseudo-random number generators.
ranlux pseudo-random number generators (PRNGs) are a family of high-quality
PRNGs. This git repository contains programs searching for valid ranlux
parameters. The code is licensed under the
[
Mozilla Public License
2.
0](https://www.mozilla.org/en-US/MPL/2.0/).
A ranlux PRNG works as follows:
*
It draws
`p`
random values from an add-with-carry (AWC) PRNG or a
subtract-with-borrow (SWB) PRNG.
*
It returns
`r <= p`
values and discards the rest.
*
Repeat.
Ranlux PRNGs have four parameters and all of them are positive integers:
*
Base
`b >= 2`
, long lag
`r`
, and short lag
`s`
with
`r > s`
.
*
Block size
`p >= r`
.
Valid parameter choices must fulfill certain number theoretical criteria and the
search for such parameters is automated by the scripts in this repository.
AWC and SWB PRNGs were introduced in a paper by Marsaglia and Zaman:
> G. Marsaglia, A. Zaman: "A New Class of Random Number Generators." In: The
> Annals of Applied Probability, Vol. 1, Issue 3, pp. 462-480. 1991.
AWC and SWB PRNGs have solid theoretical foundations but in practice it is
necessary to discard values and this was discussed by Lüscher:
> M. Lüscher: "A Portable High-Quality Random Number Generator for Lattice Field
> Theory Simulations." In: Computer Physics Communications, Vol. 79, Issue 1,
> pp. 100-110. 1994. arXiv:hep-lat/9309020
The Bash script
`find-awc-swb-prngs.sh`
will call the various scripts in this
repository to find AWC/SWB parameters and a block size. The output has to be
read as follows:
*
`awc`
denotes with an add-with-carry PRNG with base
`b`
, long lag
`r`
, and
short lag
`s`
.
*
`cawc`
is a complementary AWC generator.
*
`swb`
is a subtract-with-borrow PRNG with base
`b`
, long lag
`r`
, and short
lag
`s`
. Its recurrence is
`x_n = x_{n-r} - x_{n-s} - c`
, where
`c`
is the
carry bit.
*
`swc`
is a subtract-with-borrow PRNG with recurrence
`x_n = x_{n-s} - x_{n-r}
- c`
(note the different order of the terms). This generator is also an SWB
but seeing that the C++11 standard library calls the class implementing this
generator
`subtract_with_carry`
, we decided to use the acronym
`swc`
.
*
`t`
is the time parameter from Lüscher's chaotic dynamical system discussion
of AWC and SWBs PRNGs.
To compute the block size
`p`
, we suggest to use the smallest prime number
larger than
`t * r`
, e.g., for the popular 24-bit ranlux, we have
`b=2^24`
,
`r=24`
,
`s=10`
, and
`t = 16`
. It holds that
`t * p = 16 * 24 = 384`
so
`p =
389`
. Note that in practice, prime values larger than
`t*p / 4`
are often
sufficient to pass all empirical random number generator tests.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment