On 2013-09-05, John Lapeyre <lapeyre.math122a at gmail.com> wrote:
> (%i1) float(bfloat(1000!)^0.01)
> (%o1) 4.7429270206609955e+25
>
> The exception, is maxima with gcl 2.6.9, which returned nothing, and
> reported no error.
Hmm, with GCL 2.6.9, I get:
(%i4) float(bfloat(1000!)^0.01);
(%o4) 4.7429270206609955E+25
(%i5) build_info ();
(%o5)
Maxima version: "5.31.0_6_ga50546b"
Maxima build date: "2013-09-05 10:23:43"
Host type: "i686-pc-linux-gnu"
Lisp implementation type: "GNU Common Lisp (GCL)"
Lisp implementation version: "GCL 2.6.9"
> I think maxima is not trying hard enough to get the correct answer. I
> suppose it would slow things down, but it would be possible to give a
> correct double float answer.
Well, the code to evaluate floating point results essentially assumes
that one can get a float result by starting with float arguments and
pushing them through any functions. That mostly works OK but fails in
this case because there is some problematic intermediate result.
To overcome that problem, one could (I guess) carry out an analysis
of the expression in question and devise a way (e.g. pattern matching
to find an appropriate heuristic) to evaluate it to a number. I think
that would be valuable and interesting, and perhaps even tractable --
it could be constructed as a stand-alone function until it seems ready
to replace the existing 'float' function.
best
Robert Dodier