Re: +-Inf and NaN

Richard Fateman <[email protected]> Wed, 28 Feb 2024 08:18:35 -0800
Newsgroups gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel
Message-ID <CADB8Zm6aqcjHki_+E1MmD8sajcT7V=6=E9xdn6z9UScRruvy_w@mail.gmail.com>
Several of us here have worked on arbitrary-precision floats in Lisp
(generally used for
 longer than double, though I suppose shorter could also be specified...),
and I think the real win would be to make use of the mpfr library (written
in C with various assembly-language hacks for different CPUs).
 I think that Mathematica and Maple use this. [ there is a neutral
"no assembly" version of the code.]  It would be neat if the underlying
Lisp did the
interface.  For Maxima, it would be tricky if we want it to be agnostic
about
 the choice of underlying Lisp.
using mpfr frees the Lisp or Maxima support crew from worrying about getting
the very best algorithms du jour, etc.
RJF


On Wed, Feb 28, 2024 at 7:52 AM Stavros Macrakis <[email protected]> wrote:

> I can think of two reasons that it might be useful to have *shorter*
> floats:
>
>    - To save time and space.
>    - To replicate calculations being done on a short-float platform.
>
> The first one is super important when you're doing huge calculations (ML
> training, rendering a movie) or low-latency calculations (ML inference,
> real-time graphics) and precision isn't important. But I don't think anyone
> is using Maxima for that.
>
> The second one might be useful to a few people.
>
> I can think of one reason that it might be useful to have *longer* floats:
>
>    - To do high-precision calculations much faster than with
>    bfloats (either with direct hardware support or with fast libraries).
>
> I don't know how much demand there is for this. bfloats are extremely
> slow, but allow *arbitrary *precision.
>
>
>
> On Wed, Feb 28, 2024 at 10:40 AM Camm Maguire <[email protected]>
> wrote:
>
>> Greetings!
>>
>> Does anyone care about anything other than 4 or 8 byte floats?  (BTW the
>> current definition of single-float in GCL is one of the two permissible
>> by the spec for the case of two supported formats.)
>>
>> gcl:
>> >(list  most-positive-short-float  most-positive-single-float
>> most-positive-double-float  most-positive-long-float)
>>
>> (3.4028235S38 1.7976931348623158E308 1.7976931348623158E308
>> 1.7976931348623158E308)
>>
>> sbcl:
>> * (list  most-positive-short-float  most-positive-single-float
>> most-positive-double-float  most-positive-long-float)
>> (3.4028235e38 3.4028235e38 1.7976931348623157d308 1.7976931348623157d308)
>>
>> clisp:
>> [1]> (list  most-positive-short-float  most-positive-single-float
>> most-positive-double-float  most-positive-long-float)
>> (3.4028s38 3.4028235E38 1.7976931348623157d308
>> 8.8080652584198167656L646456992)
>>
>> ecl:
>> > (list  most-positive-short-float  most-positive-single-float
>> most-positive-double-float  most-positive-long-float)
>> (3.4028235e38 3.4028235e38 1.7976931348623157d308
>> 1.189731495357231765l4932)
>>
>>
>>
>> Take care,
>> --
>> Camm Maguire
>> [email protected]
>> ==========================================================================
>> "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
>>
>

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss