How to deal with r^(bfloat(2/3))/r^(2.0/3)



On Thu, Dec 13, 2007 at 12:27:17AM +0800, zycentre wrote:
> (%i5) r^(bfloat(2/3))/r^(2.0/3);
>                                             -.19073b-6
> (%o5)                             r
> 
> The right result should be 1.
> The reason is:
> (%i6) (bfloat(2/3))-(2.0/3);
> (%o6)                             -.19073b-6
> 
> So, I want to set a rule: when the index less than a certain value, like 1.e-6, take it as 0.

Others have given you information about how bfloats are handled in
current versions of maxima. Here is some advice about your desire to
convert a^b = a^0 when b is small.

http://maxima.sourceforge.net/docs/manual/en/maxima_36.html#SEC146

is the section on rules and matching in the maxima manual. Your best
bet is probably to set a tellsimpafter rule that matches a^b and
checks to see if b is a floating point or bfloat number and then
checks to see if abs(b) < your threshold. You could try setting the
threshold to a small multiple of fpprec (say 8 * fpprec).


-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan