puzzle with bfloat and radcan



Shameless plug for nfloat:

 (%i1) load(hypergeometric)$

 (%i2) nfloat(expand(product(q-i,i,1,16)), [q=15.0], 19);
 (%o2) -3.310444991333235832b-55

Oops...? doesn't find nfloat.

--bw
________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Stavros Macrakis [macrakis at alum.mit.edu]
Sent: Tuesday, May 15, 2012 12:34
To: Richard Fateman
Cc: Maxima - list
Subject: Re: [Maxima] puzzle with bfloat and radcan

Not sure why any of this is a "puzzle".  The value of an expression evaluated to some number of digits depends on the form of the expression.  Consider

product(q-i,i,1,16)

Obviously this is 0 for q in 1..16 (even 1.0 .. 16.0):

subst(q=15.0,product(q-i,i,1,16)) => 0

but

subst(q=15.0,expand(product(q-i,i,1,16))) => -215040.0

This is not a puzzle or an error.  It is the nature of finite-precision calculation.

            -s

On Mon, May 14, 2012 at 6:42 PM, Richard Fateman <fateman at eecs.berkeley.edu<mailto:fateman at eecs.berkeley.edu>> wrote:
xnum : ((6-4*sqrt(2))*log(3-2*sqrt(2))+(3-2*sqrt(2))*log(17-12*sqrt(2))+32-24*sqrt(2));
xden :(48*sqrt(2)-72)*(log(sqrt(2)+1)+sqrt(2))/3;
x    : xnum/xden;