34#define MAX_IBF_DECODE 16
54main (
int argc,
char **argv)
57 unsigned int buckets[31];
62 unsigned long long total;
66 srandom (time (NULL));
68 want = atoi (argv[1]);
69 for (round = 0; round <
ROUNDS; round++)
71 memset (buckets, 0,
sizeof(buckets));
72 for (i = 0; i < want; i++)
80 for (j = 0; (j < 31) && (0 == (r & (1 << j))); j++)
84 j = __builtin_ffs (r) - 1;
90 for (j = 31; j >= 0; j--)
100 ret *= (1 << (j + 1));
113 ret *= (1 << (j + 1));
122 ret *= (1 << (j + 1));
127 predict = (buckets[j] + 2.0 * predict) / 2.0;
130 fprintf (stderr,
"%u ",
ret);
134 fprintf (stderr,
"\n");
135 fprintf (stdout,
"average %llu\n", total /
ROUNDS);
int main(int argc, char **argv)
static int ret
Final status code.