diff --git a/src/random.h b/src/random.h index 6efc957e004e7a9859cfbb928c0b5ac1b5ed23f8..9b894568c6987f9c7f72ef0b3ca9cddf7c1eb39b 100644 --- a/src/random.h +++ b/src/random.h @@ -30,22 +30,22 @@ * @brief The categories of random number generated. * * The values of the fields are carefully chose numbers - * These are values adviced by NR to use on page - * 348 in the first table. We used selected 4 numbers - * and know that they produce no correlation at all - * for the 4 different processes. + * the numbers are very large primes such that the IDs + * will not have a prime factorization with this coefficient + * this results in a very high period for the random number + * generator. * Only change when you know what you are doing, changing * the numbers to bad values will break the random number * generator. * In case new numbers need to be added other possible * numbers could be: - * 4162943475, 3874257210, 2654432763 + * 4947009007, 5947309451, 6977309513 */ enum random_number_type { - random_number_star_formation = 0LL, //4294957665LL, - random_number_stellar_feedback = 3947008974LL, - random_number_stellar_enrichment = 2936881968LL, - random_number_BH_feedback = 1640531364LL + random_number_star_formation = 0LL, + random_number_stellar_feedback = 3947008991LL, + random_number_stellar_enrichment = 2936881973LL, + random_number_BH_feedback = 1640531371LL }; /** @@ -89,7 +89,7 @@ INLINE static double random_unit_interval(const long long int id, * in which we use the id part and the current time step bin. */ unsigned long long number = ti_current; - /* Multiply with carry (MWC) */ + /* Multiply with carry (MWC), (adviced variables by NR) */ number = 4294957665LL * (number & (mwc_number)) + (number >> 32); /* 64-bit Xorshift (adviced variables by NR) */ number ^= number << 21;