1 #include <cln/number.h>
3 #include <cln/integer.h>
6 #include <cln/random.h>
7 #include "cl_random_impl.h"
11 #include <cln/timing.h>
14 int main (int argc, char * argv[])
17 if ((argc >= 3) && !strcmp(argv[1],"-r")) {
18 repetitions = atoi(argv[2]);
23 uintL a_len = atoi(argv[1]);
24 uintL b_len = atoi(argv[2]);
25 if (!(a_len >= b_len && b_len > 0))
36 num_stack_alloc(a_len,a_MSDptr=,a_LSDptr=);
37 num_stack_alloc(b_len,b_MSDptr=,b_LSDptr=);
38 num_stack_alloc(a_len,q_MSDptr=,q_LSDptr=);
39 num_stack_alloc(a_len,q1_MSDptr=,q1_LSDptr=);
40 random_UDS(default_random_state,a_MSDptr,a_len);
41 random_UDS(default_random_state,b_MSDptr,b_len);
42 lspref(b_LSDptr,0) |= 1; // force b to be odd
44 for (int rep = repetitions; rep > 0; rep--)
45 { div2adic(a_len,a_LSDptr,b_len,b_LSDptr,q_LSDptr); }