# [Maxima] Package bigfloat

Raymond Toy raymond.toy at ericsson.com
Fri Jan 23 17:09:37 CST 2009

```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

```