1 #include <cln/number.h>
5 #include <cln/random.h>
8 #include <cln/timing.h>
11 int main (int argc, char * argv[])
14 if ((argc >= 3) && !strcmp(argv[1],"-r")) {
15 repetitions = atoi(argv[2]);
20 uintL len = atoi(argv[1]);
21 extern cl_LF compute_catalanconst_ramanujan (uintC len);
22 extern cl_LF compute_catalanconst_ramanujan_fast (uintC len);
23 extern cl_LF compute_catalanconst_expintegral1 (uintC len);
24 extern cl_LF compute_catalanconst_expintegral2 (uintC len);
25 extern cl_LF compute_catalanconst_cvz1 (uintC len);
26 extern cl_LF compute_catalanconst_cvz2 (uintC len);
28 ln(cl_I_to_LF(1000,len+10)); // fill cache
30 for (int rep = repetitions; rep > 0; rep--)
31 { p = compute_catalanconst_ramanujan(len); }
35 for (int rep = repetitions; rep > 0; rep--)
36 { p = compute_catalanconst_ramanujan_fast(len); }
41 for (int rep = repetitions; rep > 0; rep--)
42 { p = compute_catalanconst_expintegral1(len); }
46 for (int rep = repetitions; rep > 0; rep--)
47 { p = compute_catalanconst_expintegral2(len); }
52 for (int rep = repetitions; rep > 0; rep--)
53 { p = compute_catalanconst_cvz1(len); }
57 for (int rep = repetitions; rep > 0; rep--)
58 { p = compute_catalanconst_cvz2(len); }