[PATCH, fortran/52879] RANDOM_SEED revisited
Steve Kargl
sgk@troutmask.apl.washington.edu
Sun Feb 9 19:07:00 GMT 2014
On Sun, Feb 09, 2014 at 10:28:47AM +0000, N.M. Maclaren wrote:
>
> Unless it has been changed since 4.5.1, they are not independent;
> they are merely separate. Using 3 copies of them probably does not
> make any significant difference - if you want to get a benefit from
> combining generators, then you must use ones based on very distinct
> mathematical properties, or where they have known independence.
I suppose it's a matter of semantics as in a short email I am not
going to worry about the inconsequential details. But, yes,
random_number uses 3 different sequences drawn from Marsaglia's KISS
generator. One might even say those 3 different sequences are
independent, but this is totally irrelevant to the patch at hand.
The 3 different sequences are not being combined to generate some
new 32-bit entity. The first sequence gives bits 0-31, the second
sequence gives bits 32-63, and the third sequence gives bits 64-112.
In terms of bits, the REAL types then uses
REAL(4) <--> 0-23 bits for significand
REAL(8) <--> 0-53 bits for significand
REAL(10) <--> 0-63 bits for significand (for some OSs this is 0-53 bits)
REAL(16) <--> 0-112 bits for significand
See my reply to Dominique where I have code that shows why one
may want the above mapping.
--
Steve
More information about the Fortran
mailing list