# [Maxima] Package bigfloat

Dieter Kaiser drdieterkaiser at web.de
Fri Jan 23 17:37:00 CST 2009

```Am Freitag, den 23.01.2009, 18:09 -0500 schrieb Raymond Toy:
> Dieter Kaiser wrote:
> > I am working with the new package BIGFLOAT to implement the function
> > beta_incomplete(a,b,z). The first steps work fine. The numerical
> > algorithm is working for some cases. But I have some problems with the
> > generalization to all types of numbers.
> >
> > I have two problems why I could not finish the work, but which are
> > perhaps easy to solve:
> >
> > 1.
> >
> > I need the function bigfloat:expt. I have seen the declaration in the
> > package, but the function seems not to work:
> >
> > (%i7) :lisp (bigfloat:expt 2.0 2.0)
> >
> >
> First, I'm glad you're trying it out.  I haven't a chance to really use
> it for anything other than the simplest bits of code, unfortunately.
>
> Second, I probably forgot to export the symbol.  I'll look into it.
> >
> > In the numerical code I have to call other Maxima functions. The
> > following is a piece of code as an example (to be short I have called
> > the verb form of the Gamma function, that is nearly equivalent to a
> > direct call to the simplifier):
> >
> > (bigfloat:-
> >   (bigfloat:/ (bigfloat:* (bigfloat:to (\$gamma (to a)))
> >                           (bigfloat:to (\$gamma (to b))))
> >               (bigfloat:to (\$gamma (to (bigfloat:+ a b)))))
> >   (beta-incomplete b a (bigfloat:- 1.0 z))))
> >
> > To call \$gamma we have to convert the type NUMERIC to a Maxima number.
> > This is done with the function TO (or MAXIMA:TO). The result of the
> > \$gamma function is a Maxima number which has to be converted back to the
> > type NUMERIC. This is done here with the function bigfloat:to.
> >
> > But this function always converts to a type bigfloat, what I need is a
> > function which does not convert the types integer, float, ... to a
> > bigfloat, but returns the CL number e.g.
> >
> > Maxima integer        -> CL integer
> > Maxima float          -> CL float
> > Maxima complex        -> CL complex
> > Maxima bfloat         -> NUMERIC bigfloat
> > Maxima complex bfloat -> NUMERIC complex-bigfloat
> >
> > Is this functionality build in? Do I have overseen something?
> >
> >
> I'm a little confused.  Are you talking about bigfloat:to or maxima:to?
> bigfloat:to is supposed to convert everything to a bigfloat type.  If
> this is not what you want, I'll have to think about it.  Can you
> describe (in terms of the algorithm above), exactly what behaviour you
> want?  There are too many TO functions to think about.  Perhaps there
> are two too many? :-)
>
> Ray

The problem is that after a call e.g. to the Maxima function \$gamma we
get a back a Maxima number. To continue the calculation we need the
number with a type which is compatible to the calculation within the
package bigfloat. This number should not be in general a bigfloat, but a
float, CL complex, ... and a bigfloat type only for Maxima bigfloat
number.

I think such a function has to be added.

Dieter Kaiser

```