Am Freitag, den 23.01.2009, 19:57 -0500 schrieb Raymond Toy:
> Dieter Kaiser wrote:
> > 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.
> >
> >
> Ok. I understand now. I think TO should do what you want and preserve
> CL number types. When it finds '((rat) a b) it should convert to a Lisp
> rational, and '((bfloat) ...) should be a BIGFLOAT:REAL object. If
> maxima returns something like x+%i*y, TO should return a CL complex when
> possible and then a BIGFLOAT:COMPLEX object.
>
> To explicitly convert a CL number to a bigfloat, we'll have to use
> (float x <some bigfloat number>) or (coerce x 'bigfloat:real)).
>
> How does that sound?
Hello Ray,
yes, that is the functionality I need to combine a call to a Maxima
function with the calculation within the package bigfloat.
Again the example. I have named the new function convert and added the
prefix maxima to be more clear:
(bigfloat:-
(bigfloat:/
(bigfloat:*
(bigfloat:convert ($gamma (maxima:to a)))
(bigfloat:convert ($gamma (maxima:to b))))
(bigfloat:convert ($gamma (maxima:to (bigfloat:+ a b)))))
(beta-incomplete b a (bigfloat:- 1.0 z))))
Furthermore I would like to use the convention that a numerical function
is called with and returns a type compatible to the package bigfloat.
Thus a call to the numerical function beta-incomplete from the
simplifier has been implemented as
(maxima:to (beta-incomplete (bigfloat:convert a)
(bigfloat:convert b)
(bigfloat:convert z)))
Dieter Kaiser