]> www.ginac.de Git - cln.git/blob - tests/timeLFsqrt.cc
Initial revision
[cln.git] / tests / timeLFsqrt.cc
1 #include <cl_number.h>
2 #include <cl_io.h>
3 #include <cl_float.h>
4 #include <cl_float_io.h>
5 #include <cl_lfloat.h>
6 #include "cl_LF.h"
7 #include <cl_real.h>
8 #include <cl_random.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <cl_timing.h>
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         cl_LF one = cl_I_to_LF(1,len);
24         cl_F x = random_F(one);
25         cl_F y;
26         { CL_TIMING;
27           for (int rep = repetitions; rep > 0; rep--)
28             { y = sqrt(x); }
29         }
30         cout << y << endl;
31 }