[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] gcd proposal

From: Andrei Zorine
Subject: Re: [Gcl-devel] gcd proposal
Date: Tue, 13 Jan 2004 02:22:26 +0300
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0rc1) Gecko/20020417

I found the algorithm in Knuth's TAOCP vol.2. Then I decided to find out how Maxima comeputes gcd and finally found out that it delegates it to gcl. Then I patched my gcl-2.5.2 (and sent the patch to you). Later I found words 'bin-gcd' in grep's output. I think it's ok to have binary gcd in gcl instead of Maxima. I haven't seen how exactly the new code is installed, I don't know what to look at. I hope you simply replaced the get-gcd's body thith the new one.

I have also found that new gcd code works faster for fixnums than clisp's one, but still is second with bignums. The next posible step would be either to implement binary gcd for bignums, or to call mpn_gcd directly from get-gcd. I don't know which is faster yet. This needs more testing. (and reading Knuth as well :))

Camm Maguire wrote:
Greetings!  One other thought on this.  Given that you found it in
lisp in maxima, you probably need/want this code inlined in compiled
lisp functions calling gcd (with declared fixnum args of course).
Please let me know if this is the case, and we can instruct the
optimizer to inline this snippet.

Take care,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]