]> www.ginac.de Git - cln.git/blob - tests/timezeta3.cc
Remove libtool bits from the repository.
[cln.git] / tests / timezeta3.cc
1 #include <cln/number.h>
2 #include <cln/io.h>
3 #include <cln/float.h>
4 #include <cln/real.h>
5 #include <cstdlib>
6 #include <cstring>
7 #include <cln/timing.h>
8 #include "float/lfloat/cl_LF.h"
9 using namespace cln;
10 #include <iostream>
11 using namespace std;
12
13 int main (int argc, char * argv[])
14 {
15         int repetitions = 1;
16         if ((argc >= 3) && !strcmp(argv[1],"-r")) {
17                 repetitions = atoi(argv[2]);
18                 argc -= 2; argv += 2;
19         }
20         if (argc < 2)
21                 exit(1);
22         uintL len = atoi(argv[1]);
23         extern cl_LF zeta (int s, uintC len);
24         extern cl_LF compute_zeta_exp (int s, uintC len);
25         extern cl_LF compute_zeta_cvz1 (int s, uintC len);
26         extern cl_LF compute_zeta_cvz2 (int s, uintC len);
27         extern cl_LF zeta3 (uintC len);
28         cl_LF p;
29         ln(cl_I_to_LF(1000,len+10)); // fill cache
30         { CL_TIMING;
31           for (int rep = repetitions; rep > 0; rep--)
32             { p = compute_zeta_exp(3,len); }
33         }
34         cout << p << endl;
35         { CL_TIMING;
36           for (int rep = repetitions; rep > 0; rep--)
37             { p = compute_zeta_cvz1(3,len); }
38         }
39         cout << p << endl;
40         { CL_TIMING;
41           for (int rep = repetitions; rep > 0; rep--)
42             { p = compute_zeta_cvz2(3,len); }
43         }
44         cout << p << endl;
45         { CL_TIMING;
46           for (int rep = repetitions; rep > 0; rep--)
47             { p = zeta3(len); }
48         }
49         cout << p << endl;
50 }