7 (defun elementary-benchmark (N repeat)
8 (setq x1 (floor (+ (isqrt (* 5 (expt 10 (* 4 N)))) (expt 10 (* 2 N))) 2))
9 (setq x2 (isqrt (* 3 (expt 10 (* 2 N)))))
10 (setq x3 (+ (expt 10 N) 1))
11 (format t "~&~%N = ~D, Multiplication x1*x2, divide times by ~D~%" N repeat)
16 (format t "~&~%N = ~D, Division (with remainder) x1 / x2, divide times by ~D~%" N repeat)
20 (multiple-value-setq (y z) (floor x1 x2)))))
21 (format t "~&~%N = ~D, integer_sqrt(x3), divide times by ~D~%" N repeat)
25 (setq y (isqrt x3)))))
26 (format t "~&~%N = ~D, gcd(x1,x2), divide times by ~D~%" N repeat)
30 (setq y (gcd x1 x2)))))
33 (defun pari-benchmark (N repeat)
34 (format t "~&~%N = ~D, pari-benchmark, divide times by ~D~%" N repeat)
38 (let ((u 1) (v 1) (p 1) (q 1))
40 ((> k N) (setq y p z q))
44 (setq q (lcm q w)))))))))
46 (defun integer-benchmark ()
47 (elementary-benchmark 100 10000)
48 (elementary-benchmark 1000 1000)
49 (elementary-benchmark 10000 10)
50 (elementary-benchmark 100000 1)
51 (pari-benchmark 100 100)
52 (pari-benchmark 200 10)
53 (pari-benchmark 1000 1)