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