Waldek Hebisch | 14 Jun 18:17 2011
Picon

Re: modular arithmetic

Cheung Matthew G wrote:

> I was also wondering if anybody knows how performance in sbcl of
> large integer arithmetic compares to performance in gmp.

It depends on how large is "large".  Multiplying small bignums (about 20
machine words, that is few hundred digits) sbcl is comparable to gmp.
On large bignums gmp is much faster.  Also, in gmp ratio of time to do
division, gcd or integer sqrt to multiplication time is much smaller
than in sbcl.  In particular at time when I tested it integer sqrt in
gmp was faster than sbcl for all sizes (in fact, gmp could compute
integer sqrt of small bignum faster than sbcl computed integer sqrt of
a fixnum).  Recenctly, there was an improvement to integer sqrt in
sbcl so result could change, but probably not much.

It is possible to use gmp from sbcl, replacing sbcl routines by
gmp ones.  I did this for FriCAS computer algebra system (in
computer algebra speed on large bignums is important).  I also
created a version of interface to gmp which is independent
from FriCAS:

http://www.math.uni.wroc.pl/~hebisch/prog/cl-gmp-0.0.tar.bz2

This version has a bug causing wrong results when used with
gmp 4.3, but should work fine with gmp-4.2 and gmp-5.0.  I have
a bugfix, but given apparent lack of interst I did not bother
creating new release.  However, if you are interested I will
create a new version with bugfix included.

--

-- 
(Continue reading)

Nikodemus Siivola | 14 Jun 19:03 2011
Picon

Re: modular arithmetic

On 14 June 2011 19:17, Waldek Hebisch <hebisch <at> math.uni.wroc.pl> wrote:

> http://www.math.uni.wroc.pl/~hebisch/prog/cl-gmp-0.0.tar.bz2
>
> This version has a bug causing wrong results when used with
> gmp 4.3, but should work fine with gmp-4.2 and gmp-5.0.  I have
> a bugfix, but given apparent lack of interst I did not bother
> creating new release.  However, if you are interested I will
> create a new version with bugfix included.

Would you be inclined to release into public domain (or under
BSD-style licence) for inclusion into SBCL?

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Waldek Hebisch | 14 Jun 19:27 2011
Picon

Re: modular arithmetic

Nikodemus Siivola wrote:
> 
> On 14 June 2011 19:17, Waldek Hebisch <hebisch <at> math.uni.wroc.pl> wrote:
> 
> > http://www.math.uni.wroc.pl/~hebisch/prog/cl-gmp-0.0.tar.bz2
> >
> > This version has a bug causing wrong results when used with
> > gmp 4.3, but should work fine with gmp-4.2 and gmp-5.0. =C2=A0I have
> > a bugfix, but given apparent lack of interst I did not bother
> > creating new release. =C2=A0However, if you are interested I will
> > create a new version with bugfix included.
> 
> Would you be inclined to release into public domain (or under
> BSD-style licence) for inclusion into SBCL?
> 

It is already, see last sentence in the README: "I make this
code available without any restrictions".  I would be glad
to do any requested changes so that the package better fits
sbcl.

--

-- 
                              Waldek Hebisch
hebisch <at> math.uni.wroc.pl 

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
(Continue reading)


Gmane