#include #include #include #include #include "cln/cln.h" using namespace std; using namespace cln; #if defined (USG) || defined (__SVR4) || defined (_UNICOS) || defined(HPUX) #include int cputime () { if (CLOCKS_PER_SEC < 100000) return clock () * 1000 / CLOCKS_PER_SEC; return clock () / (CLOCKS_PER_SEC / 1000); } #else #include #include int cputime () { struct rusage rus; getrusage (0, &rus); return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000; } #endif int main(int argc, char *argv[]) { int n, prec, st, st2, N, i; if (argc != 2 && argc != 3) { fprintf(stderr, "Usage: timing digits \n"); exit(1); } n = atoi(argv[1]); float_format_t precision = float_format(n); cl_F x = sqrt (cl_float (3, precision)) - 1; cl_F y = sqrt (cl_float (5, precision)); cl_F z; cout << "Prec=" << precision << endl; N=1; st = cputime(); do { for (i=0;i