bfloat precision question



Sheldon Newhouse wrote:
> Sheldon Newhouse wrote:
>   
> (%i68) fp_bits(10^6);
>
> Maxima encountered a Lisp error:
>
>
> Error in function KERNEL::INTEXP:
> The absolute value of 1000000 exceeds EXTENSIONS:*INTEXP-MAXIMUM-EXPONENT*.
>
> Automatically continuing.
> To reenable the Lisp debugger set *debugger-hook* to nil.
>   
This is an issue with cmucl.  There's a check in there that if the
exponent is too large, it stops the execution.  You can change
*intexp-maximum-exponent* to something larger.   Your run the risk of
generating a bignum that won't fit in memory, though.  And newer
versions of cmucl change the error to a continuable error so you can
choose to continue with the computation if you like. I don't think that
helps maxima though because maxima handles all errors and just throws to
top-level.
> (%i69) fp_bits_1(10^5);
> (%o69) 332195
> (%i70) fp_bits_1(10^6);
> (%o70) 3321931
> (%i71) fp_bits_1(10^50);
> (%o71) 332192809488736234787031942948939017586483139302461
>
> So, the lisp implementation of ?fpprec as a function of fpprec has 
> fairly low values of fpprec allowed, but the definition using logs and 
> bfloat can go quite high.
>   
Perhaps, but what are you going to do with numbers with 3 million bits? 
Maxima and lisp can handle that, but the internal algorithms probably
aren't really good enough to deal with that in a reasonable amount of
time for interesting problems.

Ray