Skip to content

slaruv/dlaruv: fix seed advancement on rejected uniform deviate#1288

Open
jschueller wants to merge 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue1108
Open

slaruv/dlaruv: fix seed advancement on rejected uniform deviate#1288
jschueller wants to merge 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue1108

Conversation

@jschueller

Copy link
Copy Markdown
Contributor

When the computed random value rounds to exactly 1.0 (once every ~2^24 single-precision calls), both SLARAN and SLARUV reject it and recompute — but they advanced the seed differently:

SLARAN: ISEED(1:4) = IT1..IT4 (correct — carry forward the
multiplier-transformed state)
SLARUV: I1 = I1 + 2 (wrong — ad-hoc skip in seed
space)

SLARUV's +2 produces a different subsequent random sequence than SLARAN would for the same initial seed. Fix by using the same seed advancement in both: set I1..I4 = IT1..IT4, matching SLARAN.

Applies to DLARUV as well.

Closes #1108

When the computed random value rounds to exactly 1.0 (once every
~2^24 single-precision calls), both SLARAN and SLARUV reject it and
recompute — but they advanced the seed differently:

  SLARAN:   ISEED(1:4) = IT1..IT4   (correct — carry forward the
                                       multiplier-transformed state)
  SLARUV:   I1 = I1 + 2              (wrong — ad-hoc skip in seed
                                       space)

SLARUV's +2 produces a different subsequent random sequence than
SLARAN would for the same initial seed.  Fix by using the same
seed advancement in both: set I1..I4 = IT1..IT4, matching SLARAN.

Applies to DLARUV as well.

Closes Reference-LAPACK#1108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SLARUV is inconsistent with SLARND

2 participants