FPL Statistics Group
Random Number Generation Java Package
Currently (as of 4/12/04) this package contains
Java methods that permit a user to generate Uniform(0,1) or
Normal(0,1) random numbers. These methods are translations of
FORTRAN programs written in the 1980's
by James Blue, David Kahaner, and George Marsaglia.
If you are aware of high quality
random number generation routines recently written in Java, I would appreciate
hearing about them. Please e-mail me (Steve Verrill) at
- This work was performed by a user of numerical analysis
routines rather than a developer. As a user, I have
translated older FORTRAN routines with which I am comfortable.
However, random number generation routines
written in Java by professional numerical analysts now exist. You
should probably seek these out.
- I have tried to be careful with the coding and have done some
simple testing (see the
UniformTest and NormalTest
However, it is quite possible that I have introduced
errors into the routines in the course of the translations. If you
detect bugs in these routines, PLEASE contact me
(Steve Verrill at firstname.lastname@example.org
DISCLAIMER OF WARRANTIES
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
THE AUTHOR/TRANSLATOR DOES NOT WARRANT, GUARANTEE OR MAKE ANY
REPRESENTATIONS REGARDING THE SOFTWARE OR DOCUMENTATION IN TERMS
OF THEIR CORRECTNESS, RELIABILITY, CURRENTNESS, OR OTHERWISE.
THE ENTIRE RISK AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE
IS ASSUMED BY YOU. IN NO CASE WILL ANY PARTY INVOLVED WITH THE
CREATION OR DISTRIBUTION OF THE SOFTWARE BE LIABLE FOR ANY DAMAGE
THAT MAY RESULT FROM THE USE OF THIS SOFTWARE.
Sorry about that.
Here is the
documentation generated by
javadoc. Also see the source code of the routines.
The source code includes a copy of the original FORTRAN documentation.
The code comes in five files:
Given the manner in which the routines are currently written,
you will need to import them (see, for example, the beginning of
UniformTest.java). The classes
will have to be placed
in subdirectories of a directory in your CLASSPATH.
The Uniform and Normal classes will have to be placed
in a subdirectory called rannum.
will have to be placed in a
subdirectory called corejava.
Alternatively, you could remove the rannum and corejava
package and import statements
in the source code,
and compile all of the necessary files in the same directory.
Console.java is software described in Cornell
and Horstmann's Core Java (SunSoft Press/Prentice-Hall).
(I like this book.)
It may be used for non-commerical purposes. I
only make use of it in the testing routines.
If you have questions about this software,
or suggestions for improvement,
please contact me at
[FPL Statistics Group]
Last modified on 4/12/04.
As of last midnight, this page had been accessed