// applies a skip of some number of steps calculated from the four IDs
voidbranch_inplace(rng_state_t*Xin,myID_t*ID);// almost the same as apply_bigskip, but in-place and from a vector of IDs
#define BITS 61
/* magic with Mersenne Numbers */
#define M61 2305843009213693951ULL
myuintmodadd(myuintfoo,myuintbar);
myuintmodmulM61(myuints,myuinta);
myuintfmodmulM61(myuintcum,myuints,myuinta);
#define MERSBASE M61 //xSUFF(M61)
#define MOD_PAYNE(k) ((((k)) & MERSBASE) + (((k)) >> BITS) ) // slightly faster than my old way, ok for addition
#define MOD_REM(k) ((k) % MERSBASE ) // latest Intel CPU is supposed to do this in one CPU cycle, but on my machines it seems to be 20% slower than the best tricks
// the charpoly is irreducible for the combinations of N and SPECIAL and has maximal period for N=508, 256, half period for 1260, and 1/12 period for 3150
// #if (N==256)
// #define SPECIALMUL 0
// #define SPECIAL 487013230256099064ULL // s=487013230256099064, m=1 -- good old MIXMAX
// #define MOD_MULSPEC(k) fmodmulM61( 0, SPECIAL , (k) );
// #elif (N==17)
#define SPECIALMUL 36 // m=2^36+1
/*
#elif (N==8)
#define SPECIALMUL 53 // m=2^53+1
#elif (N==40)
#define SPECIALMUL 42 // m=2^42+1
#elif (N==96)
#define SPECIALMUL 55 // m=2^55+1
#elif (N==64)
#define SPECIALMUL 55 // m=2^55 (!!!) and m=2^37+2
#elif (N==120)
#define SPECIALMUL 51 // m=2^51+1 and a SPECIAL=+1 (!!!)
#define SPECIAL 1
#define MOD_MULSPEC(k) (k);
#else
#warning Not a verified N, you are on your own!
#define SPECIALMUL 58
#endif // list of interesting N for modulus M61 ends here
*/
#ifndef __MIXMAX_C // c++ can put code into header files, why cant we? (with the inline declaration, should be safe from duplicate-symbol error)