Lisp HUG Maillist Archive

Big Float in LispWorks

We need to use floating point numbers with very large exponents (larger than are supported by double/large floats).  I was unable to find anything in the LispWorks manuals or forums about how to do this, but have found a big float package by Richard Fateman plus a pointer to using the GNU mpfr package within Lisp.  Before we set down one of these paths, I was wondering whether there is something already available within LispWorks for this, or whether anyone has recommendations concerning either these two possibilities or anything else that might do the job.  Thank you. -- Paul Rosenbloom

Re: Big Float in LispWorks

On Wed, Jul 13, 2011 at 11:20, Pierpaolo Bernardi <olopierpa@gmail.com> wrote:

> Otherwise, are you aware that there is at least another CL
> implementation which supports bigfloats naively?

*naTively*    8^)


Re: Big Float in LispWorks

On Wed, Jul 13, 2011 at 01:49, Paul Rosenbloom <rosenbloom@usc.edu> wrote:
>
> We need to use floating point numbers with very large exponents (larger than are supported by double/large floats).  I was unable to find anything in the LispWorks manuals or forums about how to do this, but have found a big float package by Richard Fateman plus a pointer to using the GNU mpfr package within Lisp.  Before we set down one of these paths, I was wondering whether there is something already available within LispWorks for this, or whether anyone has recommendations concerning either these two possibilities or anything else that might do the job.  Thank you. -- Paul Rosenbloom

What operations do you need to perform on the bigfloats?

If you only need basic arithmetic, then it should be no big deal
implementing it.

Otherwise, are you aware that there is at least another CL
implementation which supports bigfloats naively?

P.


Re: Big Float in LispWorks

I would like to thank everyone for their suggestions so far.  We have also been considering implementing something more limited on our own, including a log variant, but it seemed to make sense to use a standard package if there was one that would be straightforward to incorporate into our system.  This is part of larger effort to build a cognitive architecture based on graphical models (factor graphs in particular).  The particular issue shows up when trying to emulate the behavior of particular conditional random fields for perception.  For large enough graphs, we end up with exponents during processing that go beyond the 8 bits allowed by the standard floating point formats.  We don't need a huge number of significant digits in the mantissa, but we do need a large dynamic range over the exponents.  -- PR


Updated at: 2020-12-10 08:37 UTC