1 #include <cln/number.h>
3 #include <cln/integer.h>
4 #include <cln/lfloat.h>
6 #include <cln/rational.h>
7 #include <cln/float_io.h>
8 #include <cln/random.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 cl_I m1 = cl_I(argv[1]);
24 cl_I M1 = (cl_I)1 << (intDsize*m1);
25 cl_I m2 = cl_I(argv[2]);
26 cl_I M2 = (cl_I)1 << (intDsize*m2);
27 uintL m3 = atoi(argv[1]);
30 do { u = random_I(M1); } while (zerop(u));
31 do { v = random_I(M2); } while (zerop(v) || gcd(u,v) > 1);
33 cl_LF y = The(cl_LF)(random_F(cl_I_to_LF(1,m3)));
36 for (int rep = repetitions; rep > 0; rep--)
37 { p = The(cl_LF)(cl_I_LF_div(u,The(cl_LF)(cl_LF_I_mul(y,v)))); }
41 for (int rep = repetitions; rep > 0; rep--)
42 { p = cl_RA_to_LF(x,TheLfloat(y)->len) / y; }