You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.2 KiB

25 years ago
25 years ago
25 years ago
25 years ago
  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. int main (int argc, char * argv[])
  13. {
  14. int repetitions = 1;
  15. if ((argc >= 3) && !strcmp(argv[1],"-r")) {
  16. repetitions = atoi(argv[2]);
  17. argc -= 2; argv += 2;
  18. }
  19. if (argc < 2)
  20. exit(1);
  21. uintL len = atoi(argv[1]);
  22. extern cl_LF zeta (int s, uintC len);
  23. extern cl_LF compute_zeta_exp (int s, uintC len);
  24. extern cl_LF compute_zeta_cvz1 (int s, uintC len);
  25. extern cl_LF compute_zeta_cvz2 (int s, uintC len);
  26. extern cl_LF zeta3 (uintC len);
  27. cl_LF p;
  28. ln(cl_I_to_LF(1000,len+10)); // fill cache
  29. { CL_TIMING;
  30. for (int rep = repetitions; rep > 0; rep--)
  31. { p = compute_zeta_exp(3,len); }
  32. }
  33. cout << p << endl;
  34. { CL_TIMING;
  35. for (int rep = repetitions; rep > 0; rep--)
  36. { p = compute_zeta_cvz1(3,len); }
  37. }
  38. cout << p << endl;
  39. { CL_TIMING;
  40. for (int rep = repetitions; rep > 0; rep--)
  41. { p = compute_zeta_cvz2(3,len); }
  42. }
  43. cout << p << endl;
  44. { CL_TIMING;
  45. for (int rep = repetitions; rep > 0; rep--)
  46. { p = zeta3(len); }
  47. }
  48. cout << p << endl;
  49. }