[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Bug in GFSR4 RNG code
From: |
Brian Gough |
Subject: |
Re: [Bug-gsl] Bug in GFSR4 RNG code |
Date: |
Wed, 16 Jul 2003 16:20:59 +0100 |
address@hidden writes:
> I found a couple of errors in the code for the four-tap
> shift-register-sequence random number generator (gfsr4.c) in the gsl-1.3
> distribution. I am attaching the corrected code.
Thanks for the bug report.
I've looked at the changes and I think the output of the existing
generator should be ok, although I agree it would be better to make it
consistent with r250.
I will change it in version 2.0, so that people don't get different
results from the generator when upgrading to 1.4.
If there's a problem with the actual randomness though do let me know.
best regards,
--
Brian Gough
Network Theory Ltd
15 Royal Park
Bristol BS8 3AL
United Kingdom
Tel: +44 (0)117 3179309
Fax: +44 (0)117 9048108
Web: http://www.network-theory.co.uk/
$ diff gfsr4.c ~/tmp/gfsr4_new.c
127a142
> state->nd = i-1;
133,134c148,149
< for (i=0; i<32; ++i) {
< int k=7+i*3;
---
> for (i=0; i<32; i++) {
> int k=7*i+3;
141d155
< state->nd = i;