summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-10-07 01:21:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-10-07 01:21:08 -0700
commit21e158606061246c7fcabb07b18bc5bc2f001054 (patch)
tree3aa07550d6be2de9d258e8079303db734894eafa /txr.1
parentacf39f8972db8171e4be60fc569f325fce64458f (diff)
downloadtxr-21e158606061246c7fcabb07b18bc5bc2f001054.tar.gz
txr-21e158606061246c7fcabb07b18bc5bc2f001054.tar.bz2
txr-21e158606061246c7fcabb07b18bc5bc2f001054.zip
random: bugfix: incorrect WELL512a.
* rand.c (rand32_bug): New static function formed by renaming the original buggy rand32. (rand32_good): Copy of rand32 with two bugfixes. The term involving variable r2 must be only left shifted by 28 bits, and not xor-ed with the original value. The order of operations is wrong in the term that contains the & operation. (rand32): New static function pointer variable, serving as the rand32 function. Points to rand32_good by default. (rand_compat_fixup): Test for 243 or lower compatibility, under which rand32 is made point to rand32_bug. This is done before the call to make_random_state for replacing *random-state*, which has to use the old function. * txr.1: compat note added. * tests/013/maze.expected: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.18
1 files changed, 8 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 2088419c..067f9b80 100644
--- a/txr.1
+++ b/txr.1
@@ -75522,6 +75522,14 @@ of these version values, the described behaviors are provided if
is given an argument which is equal or lower. For instance
.code "-C 103"
selects the behaviors described below for version 105, but not those for 102.
+.IP 243
+Two mistakes in the pseudo-random-number generator (PRNG) were discovered,
+affecting \*(TX 243 and older. Using this compatibility value, or lower, will
+restore the buggy behavior, allowing pseudo-random number sequences produced
+by those older versions can be reproduced. The PRNG is intended to be an
+implementation of the WELL-512 PRNG described by Panneton and L'Ecuyer.
+The coding mistakes, however, resulted in the PRNG being an implementation of
+something other than WELL-512.
.IP 242
In \*(TX 242 and older, the instantiation of an object whose type inherits
from the same supertype more than once resulted in duplicate execution