[Top][All Lists]

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

Re: [Gcl-devel] Re: [Maxima] CLOS, Bigfloats, GMP

From: Camm Maguire
Subject: Re: [Gcl-devel] Re: [Maxima] CLOS, Bigfloats, GMP
Date: 23 Nov 2004 09:33:44 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks for your feedback!  I've likely lost the head of
this thread, so please be patient if my questions are a bit out of

Richard Fateman <address@hidden> writes:

> I am by no means an expert on the GMP bigfloats. I looked
> briefly at the MPFR page, and I think I also found the
> relevant GCL-devel comment by Paul Dietz.
> The major issue in my mind is that memory allocation
> must be coordinated with the lisp GC.

This has been comprehensively solved, thankfully, in the file
gmp_wrappers.h, so should not post a problem.

> What I mean about the GC is that
> we have to be careful that when we do something like
> (setf A (make-a-new-bigfloat-externally  initial-value))
> and then
> (setf A (bigfloat-plus A 1))
> that the old value of A gets properly treated wrt lisp and gmp/mpfr.
> This presumably has been solved in using GMP big integers.


> (I had to work to get this to fit with Allegro CL strictly as
> a user-added foreign-function data type, but it was possible.)

> The things that Paul mentions don't bother
> me. Like "what is epsilon"  the smallest non-zero bigfloat?
> For bigfloats, epsilon is a function of the precision. If you
> don't have a specific precision in mind, the question doesn't make
> a lot of sense. Since the precision will presumably always have
> a value, by default if not by setting it, it's no problem.  Oh, and if
> you rebind the precision, you might also wish to re-bind epsilon.
> In maxima I think we re-bind bigfloat-%pi and bigfloat-%e at such
> times, anyway.

I think the issue hereis whether we do as you suggest above
)bigfloat-plus ...) etc., or more ambitiously try to incorporate
bigfloats as a 'first-class-type' (?) suitable as arguments to '+.
The first is of course much easier.  We'd probabvly put in a bigfloat
package with these new functions which would take lisp bignum
arguments and interpret them accordingly.  On second thought we'd
likely have to duplicate the type for use in the printer, but the
internals of the structure are exactly the same as far as I can see. 

> I don't know about max-float etc; in maxima now, I think the exponents
> are (unbounded) integer bignums. So that question doesn't make sense,
> and any algorithm depending on the question making sense should be
> re-thought.
> I suspect the mpfr software doesn't deal with how to
> combine different precisions, but even if it did, it is not
> clear that it would suit the maxima context.

Yes, I think the divergence here was in implementing a foreign library
call for maxima (easy), or supporting bigfloats transparently in a
lisp implementation (not so easy).

> So I don't see any obvious barrier.  Though the notes on the GMP page
> about bugs continue to make me a little nervous. Bugs in subtraction?


GMP has been absolutely solid in the integer domain in my experience.  

Take care,

> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gcl-devel

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

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