float bigfloat complex numbers



On 09/30/2013 05:29 AM, Robert Dodier wrote:
>  That sounds interesting. Where is the patch? I don't see it attached
>  to the message or in a link -- perhaps I am missing something.

Here is the patch for float(). It passes all rtests.
I discovered some problems with the patch for bfloat().

The motivation is that many results, from integrals or whatever,
need to have one of float(rectform(.)) or rectform(float(.)),
depending on the expression in order get a floating point result.

Basically, this chooses the principle root (modulo domain:real) for
powers when converting to floating point. Maxima already does this
for other multivalued functions:

(%i1) float(asin(1));
(%o1) 1.570796326794897
(%i2) float(asin(1+%i));
(%o2) 1.061275061905036*%i+.6662394324925153
(%i3) float(log(-1));
(%o3) 3.141592653589793*%i

I don't know if the following is in the rtests, but
the following behavior is preserved:

(%i1) float(x^2);
(%o1) x^2
(%i2) float(3^x);
(%o2) 3.0^x

An exaple of what the patch does is:

Without patch:

(%i1) float((%i+1)^(1/3));
(%o1) (%i+1.0)^(1/3)

With patch:

(%i4) float((%i+1)^(1/3));
(%o4) .2905145555072514*%i+1.084215081491351

I consider it experimental; for example: it should be reviewed,
and it probably should not be applied unless the bigfloat
patch is working.

-- John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: float-powers.patch
Type: text/x-patch
Size: 1813 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20130930/d55aa178/attachment.bin>;