floating point exponents




On Sat, 11 Sep 2010, Mahdiyar Noorbala wrote:

< I have difficulty understanding how small numbers are handled in
< Maxima. Can someone please explain the following examples?
< 
< (%i1) log(1b-308),numer;
< log: log(0) has been generated.
<  -- an error. To debug this try: debugmode(true);

You will need to tell us which version of Maxima you are
using. With the current (v5.22.1) release, I get 

log(1b-308),numer;
-709.1962086421661

< 
< ----------------------
< 
< (%i2) find_root(log(x)=-300,x,1b-308,1);
< (%o2) find_root(log(x)=-300,x,0.0,1.0)

I get
find_root(log(x)=-300,x,1b-308,1.0);
5.14820022241205e-131

Note that find_root uses floats not bfloats.


< 
< ----------------------
< 
< (%i3) find_root(x^2=1b100,x,0,1b105);
< Maxima encountered a Lisp error:
< 
< *: floating point overflow
< Automatically continuing.
< To enable the Lisp debugger set *debugger-hook* to nil.

I get the same thing with clisp and cmucl.
This seems like a bug in find_root.


< 
< ----------------------
< 
< (%i4) sqrt(1b-1000000);
< (%o4) 1.0b-500000
< 
< ----------------------
< 
< By the way, calling with bfloat() and increasing fpprec don't affect
< the results.
 
Well, this is because your bfloats are converted to
floats before computations are done.

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.