bfloat and factorials



On Fri, 13 Mar 2009 , Kostas Oikonomou  wrote:
-----------
I found your case 2 curious.  Please look at the attached
pdf file, it is a TeXmacs session.
--------------
Hi Kostas,

In your file you use create_list(...) to get agreement with both
forms  bfloat( expr(s) ) and expr( bfloat(s)).

I tried using create_list with my version without
success:

(%i1) display2d:false$
(%i2) e3f(s):=
   block( local(r3),
    define( r3(x), x!/(((x/4)!)^4 * 4^x)),
    [bfloat(r3(s)), r3(bfloat(s))] )$
(%i3) for i thru 5 do print(i,e3f(i))$
1 [8.224242345410545b-17,3.703869476219558b-1]
2 [2.026423672846756b-1,2.026423672846756b-1]
3 [2.917637057313677b-17,1.313986916412023b-1]
4 [9.375b-2,9.375b-2]
5 [1.579054530318825b-17,7.111429394341552b-2]
(%i4) create_list(e3f(j),j,1,5);
(%o4) [[8.224242345410545b-17,3.703869476219558b-1],
       [2.026423672846756b-1,2.026423672846756b-1],
       [2.917637057313677b-17,1.313986916412023b-1],[9.375b-2,9.375b-2],
       [1.579054530318825b-17,7.111429394341552b-2]]
(%i5) r3(2);
(%o5) r3(2)
( note that making r3 a "local local" using the keyword local
 denies global access to the function r3),

and then I tried one of the two versions you presented
in your pdf file, which looked something like:

(%i6) e5f(s):=
   block([r5 ],
     r5(x):= x!/(((x/4)!)^4 * 4^x),
    [bfloat(r5(s)), r5(bfloat(s))] )$
(%i7) for i thru 5 do print(i,e5f(i))$
1 [8.224242345410545b-17,3.703869476219558b-1]
2 [2.026423672846756b-1,2.026423672846756b-1]
3 [2.917637057313677b-17,1.313986916412023b-1]
4 [9.375b-2,9.375b-2]
5 [1.579054530318825b-17,7.111429394341552b-2]
(%i8) create_list(e5f(j),j,1,5);
(%o8) [[8.224242345410545b-17,3.703869476219558b-1],
       [2.026423672846756b-1,2.026423672846756b-1],
       [2.917637057313677b-17,1.313986916412023b-1],[9.375b-2,9.375b-2],
       [1.579054530318825b-17,7.111429394341552b-2]]
(%i9) r5(2);
(%o9) 2/%pi^2

( note making r5 a "bracket local" provides global access to r5 here )

So both versions show disagreement with my system (windows xp, max 5.17.1).

You mention you are using Texmacs. As Raymond Toy mentioned, a subtle
bug in factorial has been recently fixed and perhaps your setup uses a later
cvs than my windows version.

best wishes,
Ted Woollett