reproducibility of GMP random functions vs limb size and GMP version
tg at gmplib.org
Wed Sep 15 17:15:04 CEST 2010
Paul Zimmermann <Paul.Zimmermann at loria.fr> writes:
Sage uses GMP random functions in a way that enables the user to access the
GMP random seed:
The MPFR random functions use the GMP random seed. However to ensure the user
he/she will get the same results (for a given seed) whatever the limb size
and/or the GMP version, we assume that the GMP random functions do not depend
on the limb size nor the GMP version. This seems to hold, but it is not
Thus my question: please could you document this fact?
There is a general principle behind GMP: Functions' semantics do not
depend on the underlying hardware (unless explicitly documented).
I'm not sure if there is a good place to reiterate this specifically for
the PRG functions. Adding a sentence like "The result computed by this
function does not depend on the word size of the computer on which GMP
is run" would be clutter, IMHO.
The obsolete PRGs (e.g. mpz_random, mpz_random2) might be somewhat
system dependent. That's one of the reasons they were replaced with
More information about the gmp-devel