1 #include <cln/number.h>
5 #include <cln/random.h>
8 #include <cln/timing.h>
9 #include "float/lfloat/cl_LF.h"
13 // FIXME: using internal functions is a bad idea (even if it works
14 // on some ELF systems)
15 extern cl_LF compute_catalanconst_ramanujan (uintC len);
16 extern cl_LF compute_catalanconst_ramanujan_fast (uintC len);
17 extern cl_LF compute_catalanconst_expintegral1 (uintC len);
18 extern cl_LF compute_catalanconst_expintegral2 (uintC len);
19 extern cl_LF compute_catalanconst_cvz1 (uintC len);
20 extern cl_LF compute_catalanconst_cvz2 (uintC len);
26 int main (int argc, char * argv[])
29 if ((argc >= 3) && !strcmp(argv[1],"-r")) {
30 repetitions = atoi(argv[2]);
35 uintL len = atoi(argv[1]);
39 ln(cl_I_to_LF(1000,len+10)); // fill cache
41 for (int rep = repetitions; rep > 0; rep--)
42 { p = compute_catalanconst_ramanujan(len); }
46 for (int rep = repetitions; rep > 0; rep--)
47 { p = compute_catalanconst_ramanujan_fast(len); }
52 for (int rep = repetitions; rep > 0; rep--)
53 { p = compute_catalanconst_expintegral1(len); }
57 for (int rep = repetitions; rep > 0; rep--)
58 { p = compute_catalanconst_expintegral2(len); }
63 for (int rep = repetitions; rep > 0; rep--)
64 { p = compute_catalanconst_cvz1(len); }
68 for (int rep = repetitions; rep > 0; rep--)
69 { p = compute_catalanconst_cvz2(len); }