From: Carlos P.
Subject: Arbitrary precision math library
Date: 
Message-ID: <453d10b2.0109152328.1a8073a8@posting.google.com>
Hi!

  Can you recommend me a good arbitrary precision math library (a
Common Lisp implementation or simply bindings for
clisp/gcl/cmulisp/other free cl impl) for Common Lisp?
  I�m currently using clisp in Linux.

That�s all, thank you and best regards,
    Carlos

From: Peter Wood
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <80y9nfv9fx.fsf@localhost.localdomain>
·······@yahoo.com.ar (Carlos P.) writes:

> Hi!
> 
>   Can you recommend me a good arbitrary precision math library (a
> Common Lisp implementation or simply bindings for
> clisp/gcl/cmulisp/other free cl impl) for Common Lisp?
>   I�m currently using clisp in Linux.
> 
> That�s all, thank you and best regards,
>     Carlos

Clisp uses GNU MP, so it should already have what you want.
Doesn't it?

Regards,
Peter
From: Bruno Haible
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <9o2rml$5hv$1@honolulu.ilog.fr>
>>   Can you recommend me a good arbitrary precision math library (a
>> Common Lisp implementation or simply bindings for
>> clisp/gcl/cmulisp/other free cl impl) for Common Lisp?
>>   I�m currently using clisp in Linux.

CLISP already has arbitrary precision math builtin: It has arbitrary
precision integers, like all other Common Lisp implementation (but
faster than the other bignum implementations :-)). It already has
arbitrary precision floating-point numbers, in the real and complex
domain. Which no other Common Lisp implementation has. See the
impnotes.html file for details.

> Clisp uses GNU MP, so it should already have what you want.

Not exactly. CLISP uses its own arbitrary precision math routines,
which are about the same speed as GNU MP version 2.

           Bruno
From: Espen Vestre
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <w6ofoa46gd.fsf@wallace.ws.nextra.no>
······@clisp.cons.org (Bruno Haible) writes:

> precision integers, like all other Common Lisp implementation (but
> faster than the other bignum implementations :-)). 

...did you compare with MCL?

-- 
  (espen)
From: ······@ilog.fr
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <rok7yuj3vu.fsf@honolulu.ilog.fr>
Espen Vestre:
> > precision integers, like all other Common Lisp implementation (but
> > faster than the other bignum implementations :-)). 
>
> ...did you compare with MCL?

No, I don't have access to the platforms MCL runs on.

If someone could take and publish benchmarks. The following list of
operations is a good benchmark for bignum operations. Please post the
MCL timings.


A. Elementary integer computations:
   The tests are run with N = 100, 1000, 10000, 100000 decimal digits.
   Precompute x1 = floor((sqrt(5)+1)/2 * 10^(2N))
              x2 = floor(sqrt(3) * 10^N)
              x3 = 10^N+1
   Then time the following operations:
   1. Multiplication x1*x2,
   2. Division (with remainder) x1 / x2,
   3. integer_sqrt(x3),
   4. gcd(x1,x2),
B. (from Pari)
      u=1;v=1;p=1;q=1;for(k=1..1000){w=u+v;u=v;v=w;p=p*w;q=lcm(q,w);}


========================= timebench2.lisp =========================
(defvar x1)
(defvar x2)
(defvar x3)
(defvar y)
(defvar z)

(defun elementary-benchmark (N repeat)
  (setq x1 (floor (+ (isqrt (* 5 (expt 10 (* 4 N)))) (expt 10 (* 2 N))) 2))
  (setq x2 (isqrt (* 3 (expt 10 (* 2 N)))))
  (setq x3 (+ (expt 10 N) 1))
  (format t "~&~%N = ~D, Multiplication x1*x2, divide times by ~D~%" N repeat)
  (dotimes (count 3)
    (time
      (dotimes (_ repeat)
        (setq y (* x1 x2)))))
  (format t "~&~%N = ~D, Division (with remainder) x1 / x2, divide times by ~D~%" N repeat)
  (dotimes (count 3)
    (time
      (dotimes (_ repeat)
        (multiple-value-setq (y z) (floor x1 x2)))))
  (format t "~&~%N = ~D, integer_sqrt(x3), divide times by ~D~%" N repeat)
  (dotimes (count 3)
    (time
      (dotimes (_ repeat)
        (setq y (isqrt x3)))))
  (format t "~&~%N = ~D, gcd(x1,x2), divide times by ~D~%" N repeat)
  (dotimes (count 3)
    (time
      (dotimes (_ repeat)
        (setq y (gcd x1 x2)))))
)

(defun pari-benchmark (N repeat)
  (format t "~&~%N = ~D, pari-benchmark, divide times by ~D~%" N repeat)
  (dotimes (count 3)
    (time
      (dotimes (_ repeat)
        (let ((u 1) (v 1) (p 1) (q 1))
          (do ((k 1 (1+ k)))
              ((> k N) (setq y p z q))
            (let ((w (+ u v)))
              (shiftf u v w)
              (setq p (* p w))
              (setq q (lcm q w)))))))))

(defun integer-benchmark ()
  (elementary-benchmark 100 10000)
  (elementary-benchmark 1000 1000)
  (elementary-benchmark 10000 10)
  (elementary-benchmark 100000 1)
  (pari-benchmark 100 100)
  (pari-benchmark 200 10)
  (pari-benchmark 1000 1)
)
From: Thomas A. Russ
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <ymi3d5h5wmr.fsf@sevak.isi.edu>
······@ilog.fr writes:

> Espen Vestre:
> > > precision integers, like all other Common Lisp implementation (but
> > > faster than the other bignum implementations :-)). 
> >
> > ...did you compare with MCL?
> 
> No, I don't have access to the platforms MCL runs on.
>
> 
> If someone could take and publish benchmarks. The following list of
> operations is a good benchmark for bignum operations. Please post the
> MCL timings.

OK, here they are:

This is for MCL 4.3.1 running on a 300 MHz PowerPC G3 (beige).
Compiler options set via
   (declaim (optimize (speed 3) (safety 0) (space 0) (debug 0)))

> A. Elementary integer computations:
>    The tests are run with N = 100, 1000, 10000, 100000 decimal digits.
>    Precompute x1 = floor((sqrt(5)+1)/2 * 10^(2N))
>               x2 = floor(sqrt(3) * 10^N)
>               x3 = 10^N+1
>    Then time the following operations:
>    1. Multiplication x1*x2,
>    2. Division (with remainder) x1 / x2,
>    3. integer_sqrt(x3),
>    4. gcd(x1,x2),
> B. (from Pari)
>       u=1;v=1;p=1;q=1;for(k=1..1000){w=u+v;u=v;v=w;p=p*w;q=lcm(q,w);}

================================================================
Short form:

	100	1000	10000	100000

A.1	0.021	1.6	153	16900	ms
	0.13	1.3	 12.4	  125	x 10^3 bytes allocated

A.2	0.042	1.2	 99	10450	ms
	0.10	0.9	 20.8	  208	x 10^3 bytes allocated

A.3	0.18    1.37	 65	 6280	ms
	0.68    4.9	 52.4	  757	x 10^3 bytes allocated

A.4	1.7    42.5    3257    443000	ms
        5.8   414.5   43512  11991249	x 10^3 bytes allocated



       100    200      1000

B.     14.5   118      2150      ms
     4592    3280     51996      x 10^3 bytes allocated


================================================================


Long form:

 (integer-benchmark)

N = 100, Multiplication x1*x2, divide times by 10000
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 207 milliseconds (0.207 seconds) to run.
Of that, 1 milliseconds (0.001 seconds) were spent in The Cooperative Multitasking Experience.
 1,360,000 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 219 milliseconds (0.219 seconds) to run.
Of that, 6 milliseconds (0.006 seconds) were spent in The Cooperative Multitasking Experience.
 1,360,016 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 216 milliseconds (0.216 seconds) to run.
Of that, 3 milliseconds (0.003 seconds) were spent in The Cooperative Multitasking Experience.
 1,360,024 bytes of memory allocated.

N = 100, Division (with remainder) x1 / x2, divide times by 10000
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 427 milliseconds (0.427 seconds) to run.
Of that, 9 milliseconds (0.009 seconds) were spent in The Cooperative Multitasking Experience.
 1,040,016 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 505 milliseconds (0.505 seconds) to run.
Of that, 83 milliseconds (0.083 seconds) were spent in The Cooperative Multitasking Experience.
 1,040,024 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 467 milliseconds (0.467 seconds) to run.
Of that, 44 milliseconds (0.044 seconds) were spent in The Cooperative Multitasking Experience.
 1,040,040 bytes of memory allocated.

N = 100, integer_sqrt(x3), divide times by 10000
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 2,179 milliseconds (2.179 seconds) to run.
Of that, 94 milliseconds (0.094 seconds) were spent in The Cooperative Multitasking Experience.
201 milliseconds (0.201 seconds) was spent in GC.
 6,880,224 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 1,956 milliseconds (1.956 seconds) to run.
Of that, 103 milliseconds (0.103 seconds) were spent in The Cooperative Multitasking Experience.
 6,880,120 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 1,990 milliseconds (1.990 seconds) to run.
Of that, 137 milliseconds (0.137 seconds) were spent in The Cooperative Multitasking Experience.
 6,880,120 bytes of memory allocated.

N = 100, gcd(x1,x2), divide times by 10000
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 17,982 milliseconds (17.982 seconds) to run.
Of that, 964 milliseconds (0.964 seconds) were spent in The Cooperative Multitasking Experience.
364 milliseconds (0.364 seconds) was spent in GC.
 57,681,848 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 17,818 milliseconds (17.818 seconds) to run.
Of that, 1,008 milliseconds (1.008 seconds) were spent in The Cooperative Multitasking Experience.
183 milliseconds (0.183 seconds) was spent in GC.
 57,681,032 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 18,018 milliseconds (18.018 seconds) to run.
Of that, 1,020 milliseconds (1.020 seconds) were spent in The Cooperative Multitasking Experience.
364 milliseconds (0.364 seconds) was spent in GC.
 57,681,032 bytes of memory allocated.

N = 1000, Multiplication x1*x2, divide times by 1000
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,673 milliseconds (1.673 seconds) to run.
Of that, 78 milliseconds (0.078 seconds) were spent in The Cooperative Multitasking Experience.
 1,256,144 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,680 milliseconds (1.680 seconds) to run.
Of that, 97 milliseconds (0.097 seconds) were spent in The Cooperative Multitasking Experience.
 1,256,144 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,720 milliseconds (1.720 seconds) to run.
Of that, 134 milliseconds (0.134 seconds) were spent in The Cooperative Multitasking Experience.
 1,256,184 bytes of memory allocated.

N = 1000, Division (with remainder) x1 / x2, divide times by 1000
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 1,262 milliseconds (1.262 seconds) to run.
Of that, 39 milliseconds (0.039 seconds) were spent in The Cooperative Multitasking Experience.
 856,112 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 1,318 milliseconds (1.318 seconds) to run.
Of that, 97 milliseconds (0.097 seconds) were spent in The Cooperative Multitasking Experience.
 856,144 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 1,345 milliseconds (1.345 seconds) to run.
Of that, 125 milliseconds (0.125 seconds) were spent in The Cooperative Multitasking Experience.
 856,144 bytes of memory allocated.

N = 1000, integer_sqrt(x3), divide times by 1000
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 1,388 milliseconds (1.388 seconds) to run.
Of that, 14 milliseconds (0.014 seconds) were spent in The Cooperative Multitasking Experience.
 4,896,144 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 1,455 milliseconds (1.455 seconds) to run.
Of that, 80 milliseconds (0.080 seconds) were spent in The Cooperative Multitasking Experience.
 4,896,144 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 1,467 milliseconds (1.467 seconds) to run.
Of that, 90 milliseconds (0.090 seconds) were spent in The Cooperative Multitasking Experience.
 4,896,176 bytes of memory allocated.

N = 1000, gcd(x1,x2), divide times by 1000
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 45,314 milliseconds (45.314 seconds) to run.
Of that, 2,742 milliseconds (2.742 seconds) were spent in The Cooperative Multitasking Experience.
2,187 milliseconds (2.187 seconds) was spent in GC.
 414,468,680 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 44,829 milliseconds (44.829 seconds) to run.
Of that, 2,441 milliseconds (2.441 seconds) were spent in The Cooperative Multitasking Experience.
1,999 milliseconds (1.999 seconds) was spent in GC.
 414,468,632 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 45,030 milliseconds (45.030 seconds) to run.
Of that, 2,469 milliseconds (2.469 seconds) were spent in The Cooperative Multitasking Experience.
2,190 milliseconds (2.190 seconds) was spent in GC.
 414,468,672 bytes of memory allocated.

N = 10000, Multiplication x1*x2, divide times by 10
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,579 milliseconds (1.579 seconds) to run.
Of that, 48 milliseconds (0.048 seconds) were spent in The Cooperative Multitasking Experience.
 124,808 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,599 milliseconds (1.599 seconds) to run.
Of that, 68 milliseconds (0.068 seconds) were spent in The Cooperative Multitasking Experience.
 124,832 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 1,601 milliseconds (1.601 seconds) to run.
Of that, 61 milliseconds (0.061 seconds) were spent in The Cooperative Multitasking Experience.
 124,872 bytes of memory allocated.

N = 10000, Division (with remainder) x1 / x2, divide times by 10
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 1,112 milliseconds (1.112 seconds) to run.
Of that, 125 milliseconds (0.125 seconds) were spent in The Cooperative Multitasking Experience.
 208,280 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 997 milliseconds (0.997 seconds) to run.
Of that, 10 milliseconds (0.010 seconds) were spent in The Cooperative Multitasking Experience.
 208,272 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 1,045 milliseconds (1.045 seconds) to run.
Of that, 54 milliseconds (0.054 seconds) were spent in The Cooperative Multitasking Experience.
 208,280 bytes of memory allocated.

N = 10000, integer_sqrt(x3), divide times by 10
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 668 milliseconds (0.668 seconds) to run.
Of that, 21 milliseconds (0.021 seconds) were spent in The Cooperative Multitasking Experience.
 524,000 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 700 milliseconds (0.700 seconds) to run.
Of that, 51 milliseconds (0.051 seconds) were spent in The Cooperative Multitasking Experience.
 524,000 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 682 milliseconds (0.682 seconds) to run.
Of that, 34 milliseconds (0.034 seconds) were spent in The Cooperative Multitasking Experience.
 524,000 bytes of memory allocated.

N = 10000, gcd(x1,x2), divide times by 10
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 32,574 milliseconds (32.574 seconds) to run.
Of that, 1,752 milliseconds (1.752 seconds) were spent in The Cooperative Multitasking Experience.
2,187 milliseconds (2.187 seconds) was spent in GC.
 435,119,960 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 32,630 milliseconds (32.630 seconds) to run.
Of that, 1,765 milliseconds (1.765 seconds) were spent in The Cooperative Multitasking Experience.
2,181 milliseconds (2.181 seconds) was spent in GC.
 435,120,736 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 33,452 milliseconds (33.452 seconds) to run.
Of that, 2,643 milliseconds (2.643 seconds) were spent in The Cooperative Multitasking Experience.
2,187 milliseconds (2.187 seconds) was spent in GC.
 435,120,712 bytes of memory allocated.

N = 100000, Multiplication x1*x2, divide times by 1
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 17,078 milliseconds (17.078 seconds) to run.
Of that, 108 milliseconds (0.108 seconds) were spent in The Cooperative Multitasking Experience.
 124,616 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 17,091 milliseconds (17.091 seconds) to run.
Of that, 44 milliseconds (0.044 seconds) were spent in The Cooperative Multitasking Experience.
 124,616 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (* X1 X2))) took 17,024 milliseconds (17.024 seconds) to run.
Of that, 44 milliseconds (0.044 seconds) were spent in The Cooperative Multitasking Experience.
 124,616 bytes of memory allocated.

N = 100000, Division (with remainder) x1 / x2, divide times by 1
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 10,993 milliseconds (10.993 seconds) to run.
Of that, 547 milliseconds (0.547 seconds) were spent in The Cooperative Multitasking Experience.
 208,048 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 10,967 milliseconds (10.967 seconds) to run.
Of that, 526 milliseconds (0.526 seconds) were spent in The Cooperative Multitasking Experience.
 208,064 bytes of memory allocated.
(DOTIMES (_ REPEAT) (MULTIPLE-VALUE-SETQ (Y Z) (FLOOR X1 X2))) took 10,979 milliseconds (10.979 seconds) to run.
Of that, 526 milliseconds (0.526 seconds) were spent in The Cooperative Multitasking Experience.
 208,064 bytes of memory allocated.

N = 100000, integer_sqrt(x3), divide times by 1
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 6,621 milliseconds (6.621 seconds) to run.
Of that, 342 milliseconds (0.342 seconds) were spent in The Cooperative Multitasking Experience.
 757,928 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 6,585 milliseconds (6.585 seconds) to run.
Of that, 319 milliseconds (0.319 seconds) were spent in The Cooperative Multitasking Experience.
 757,920 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (ISQRT X3))) took 6,639 milliseconds (6.639 seconds) to run.
Of that, 362 milliseconds (0.362 seconds) were spent in The Cooperative Multitasking Experience.
 757,920 bytes of memory allocated.

N = 100000, gcd(x1,x2), divide times by 1
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 469,938 milliseconds (469.938 seconds) to run.
Of that, 26,649 milliseconds (26.649 seconds) were spent in The Cooperative Multitasking Experience.
61,711 milliseconds (61.711 seconds) was spent in GC.
 11,991,249,120 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 468,861 milliseconds (468.861 seconds) to run.
Of that, 25,782 milliseconds (25.782 seconds) were spent in The Cooperative Multitasking Experience.
61,537 milliseconds (61.537 seconds) was spent in GC.
 11,991,249,128 bytes of memory allocated.
(DOTIMES (_ REPEAT) (SETQ Y (GCD X1 X2))) took 468,128 milliseconds (468.128 seconds) to run.
Of that, 24,828 milliseconds (24.828 seconds) were spent in The Cooperative Multitasking Experience.
61,728 milliseconds (61.728 seconds) was spent in GC.
 11,991,249,136 bytes of memory allocated.

N = 100, pari-benchmark, divide times by 100
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,524 milliseconds (1.524 seconds) to run.
Of that, 77 milliseconds (0.077 seconds) were spent in The Cooperative Multitasking Experience.
 4,592,072 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,535 milliseconds (1.535 seconds) to run.
Of that, 92 milliseconds (0.092 seconds) were spent in The Cooperative Multitasking Experience.
 4,592,064 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,765 milliseconds (1.765 seconds) to run.
Of that, 137 milliseconds (0.137 seconds) were spent in The Cooperative Multitasking Experience.
184 milliseconds (0.184 seconds) was spent in GC.
 4,592,088 bytes of memory allocated.

N = 200, pari-benchmark, divide times by 10
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,189 milliseconds (1.189 seconds) to run.
Of that, 10 milliseconds (0.010 seconds) were spent in The Cooperative Multitasking Experience.
 3,280,048 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,259 milliseconds (1.259 seconds) to run.
Of that, 79 milliseconds (0.079 seconds) were spent in The Cooperative Multitasking Experience.
 3,280,048 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 1,231 milliseconds (1.231 seconds) to run.
Of that, 53 milliseconds (0.053 seconds) were spent in The Cooperative Multitasking Experience.
 3,280,064 bytes of memory allocated.

N = 1000, pari-benchmark, divide times by 1
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 22,797 milliseconds (22.797 seconds) to run.
Of that, 1,213 milliseconds (1.213 seconds) were spent in The Cooperative Multitasking Experience.
182 milliseconds (0.182 seconds) was spent in GC.
 51,995,936 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 22,983 milliseconds (22.983 seconds) to run.
Of that, 1,217 milliseconds (1.217 seconds) were spent in The Cooperative Multitasking Experience.
363 milliseconds (0.363 seconds) was spent in GC.
 51,995,968 bytes of memory allocated.
(DOTIMES (_ REPEAT) (LET ((U 1) (V 1) (P 1) (Q 1)) (DO ((K 1 (1+ K))) ((> K N) (SETQ Y P Z Q)) (LET ((W (+ U V))) (SHIFTF U V W) (SETQ P (* P W)) (SETQ Q (LCM Q W)))))) took 22,777 milliseconds (22.777 seconds) to run.
Of that, 1,204 milliseconds (1.204 seconds) were spent in The Cooperative Multitasking Experience.
188 milliseconds (0.188 seconds) was spent in GC.
 51,995,928 bytes of memory allocated.


-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Thomas A. Russ
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <ymi1yl05c19.fsf@sevak.isi.edu>
Addendum:

Tests under MacOS 9.0.4

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Eric Marsden
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <wzi4rprgk2n.fsf@laas.fr>
>>>>> "bh" == haible  <······@ilog.fr> writes:

  bh> If someone could take and publish benchmarks. The following list
  bh> of operations is a good benchmark for bignum operations. Please
  bh> post the MCL timings.

here are the results from running a number of performance benchmarks
on OpenMCL (which I assume is comparable in speed to MCL) and CLISP,
on linuxppc. I have included your bignum tests, where CLISP is up to
20 times faster than OpenMCL. On other tests it is over 10 times
slower. 

To interpret the results: the "Reference" column is the user time
taken by the reference implementation (here OpenMCL 0.7) in seconds,
and the other column is a multiple of this time (eg, a figure of 1.3
means 30% slower than the reference). A -1 means the corresponding
test was not executed (CLISP does not support certain types of method
combination, for example). 

,----
| Benchmark                 Reference  CLISP
| ------------------------------------------
| Boyer                          4.86   4.02
| Browse                         1.96   2.70
| DDerviv                        2.69   3.34
| Deriv                          4.52   3.71
| Destructive                    2.42   5.36
| div2-test-1                    3.35   4.18
| div2-test2                     1.67   4.23
| FFT                           11.82   1.59
| frpoly/fixnum                  2.29   4.79
| frpoly/bignum                  4.36   2.57
| frpoly/float                   2.83   2.68
| Puzzle                        17.43   2.41
| CTak                           2.90   6.00
| Tak                            1.98  11.31
| RTak                           1.98  11.31
| takl                           6.55   5.02
| stak                           2.71   6.63
| fprint                         4.52   1.27
| traverse                       6.65  10.83
| triangle                       6.83  11.89
| factorial                      1.61   2.22
| fib                            0.46  11.24
| bignum/elem-100-10000         67.84   0.05
| bignum/elem-1000-1000        330.30   0.05
| bignum/elem-10000-10         314.55   0.04
| bignum/elem-100000-1          68.20   0.05
| bignum/pari-100-100            4.75   0.39
| bignum/pari-200-100           44.97   0.34
| bignum/pari-1000-1           132.34   0.28
| hashtable                      4.64   2.20
| CLOS/defclass                  0.61   3.90
| CLOS/defmethod                 0.25   2.28
| CLOS/instantiate              25.56   0.88
| CLOS/methodcalls              18.45   2.09
| CLOS/method+after              7.75   2.57
| CLOS/complex-methods           2.44  -1.00
| 1D-arrays                      4.68   5.30
| bitvectors                     8.44   0.48
| fill-strings                 183.24   0.61
| fill-strings/adjustable      100.52   2.02
| 
| Reference implementation: OpenMCL Version (Beta: linux) 0.7
| Impl CLISP: CLISP 2.27 (released 2001-07-17) (built 3210398221) (memory 3210398634)
`----

This is on a PowerPC750 (G3) at 450MHz, 1024Kb L2 cache, 256MB RAM
running linuxppc 2.2.18. The programs are compiled with (speed 3)
(space 0) (safety 1). Source code for the tests is available at

   <URL:http://www.chez.com/emarsden/downloads/cl-bench.tar.gz>

Obviously, the best benchmark is your application. 

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>
From: Christopher Stacy
Subject: Re: Arbitrary precision math library
Date: 
Message-ID: <u7kuyitnv.fsf@spacy.Boston.MA.US>
>>>>> On 16 Sep 2001 00:28:16 -0700, Carlos P ("Carlos") writes:

 Carlos> Hi!
 Carlos>   Can you recommend me a good arbitrary precision math library (a
 Carlos> Common Lisp implementation or simply bindings for
 Carlos> clisp/gcl/cmulisp/other free cl impl) for Common Lisp?

Integer arithmetic in ANSI Common Lisp *is* of unbounded precision,
and that of course also includes rationals.