This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch libfortran/28452] random intrinsics for large reals


On Sat, Jul 29, 2006 at 06:12:03PM -0400, Jack Howarth wrote:

Hi Jack,

thanks a lot for your testing.  It's hard (at least for me) to do
eyeball testing when you don't have the hardware to support
the tests.

>    Actually this still doesn't look quite right. You have only
> KISS_DEFAULT_SEED_1, KISS_DEFAULT_SEED_2 and KISS_DEFAULT_SEED_3
> defined in random.c but you have kiss_seed_4 later in the original
> patch. Wouldn't that imply that there should be a KISS_DEFAULT_SEED_4
> defined as well?

The plan behind the different RNGs is the following:

- kiss_seed_1 supplies all of the bits (usually 1..24) for REAL(4)
  and the most signigicant bits (1..32) for all other REAL types

- kiss_seed_2 supplies bits 33..53 (usually) for REAL(8) and
  33..64 for REAL(10) and REAL(16)

This ensures that the random number sequences for different REAL
types are identical up to available accuracy.

- kiss_seed_3 supplies the rest of the bits for REAL(16) (64.. 128,
  as far as they are needed).  It is called twice because there is
  no type that requires 96 random bits of accuracy, and KISS
  is good enough you can put together the remainers of the
  random number from two calls.

We could use a fourth RNG (and you found the leftovers of this),
but this would require 4 additional integers of state.

Here's an updated patch, which I hope solves the problems you
found so far.  I'd appreciate if you could test it.

Anybody with an S/370?

	Thomas

Attachment: random-patch-4.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]