From 7534012a4efa3d7f269891b7614b212398914e9d Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Mon, 30 Apr 2012 16:02:11 +0200 Subject: Share precomputed (n-popcount(n)). --- gen-fac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gen-fac.c') diff --git a/gen-fac.c b/gen-fac.c index 398addef0..9ec5727a0 100644 --- a/gen-fac.c +++ b/gen-fac.c @@ -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 -- cgit v1.2.1