diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-04-30 16:02:11 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-04-30 16:02:11 +0200 |
commit | 7534012a4efa3d7f269891b7614b212398914e9d (patch) | |
tree | e3f06b9eb059936fe2ddf1c5ab9c79e17e0fe1bb /gen-fac.c | |
parent | 78d7dd516a6121a5323cda6c79b8736e9d16774e (diff) | |
download | gmp-7534012a4efa3d7f269891b7614b212398914e9d.tar.gz |
Share precomputed (n-popcount(n)).
Diffstat (limited to 'gen-fac.c')
-rw-r--r-- | gen-fac.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -178,18 +178,23 @@ gen_consts (int numb, int nail, int limb) } printf (")\n"); + ofe = (ofe / 16 + 1) * 16; + printf ("\n/* This table contains 1i-popc(2i) for small i */\n"); printf ("\n/* It begins with 2-1=1 (N=1) */\n"); printf ("#define TABLE_2N_MINUS_POPC_2N 1"); - for (b = 4;b <= ofe + 1; b+=2) + for (b = 4; b <= ofe; b += 2) { mpz_set_ui (x, b); printf (",%lu",b - mpz_popcount (x)); } printf ("\n"); + printf + ("#define TABLE_LIMIT_2N_MINUS_POPC_2N %i\n", ofe + 1); + ofl = (ofl + 1) / 2; printf |