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)
Maxima encountered a Lisp error:
READ from #<INPUT STRING-INPUT-STREAM>: #<PACKAGE BIGFLOAT> has no
external symbol with name "EXPT"
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
A workaround is to use the Maxima function power. In this case we get
the second problem too.
2.
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?
Dieter Kaiser