[Maxima] Fast conversion to bfloat?

Raymond Toy toy.raymond at gmail.com
Tue Dec 8 08:55:35 CST 2009


Bug 2910001 lists an issue with slow conversion of bfloat inputs.  Yes,
for bfloats with 1 million digits, the conversion from the input form to
a bfloat is slow.

This is caused by how maxima does the conversion.  The example in the
report is 3.4b5000000.  Maxima essentially compute 34/10*10^5000000. 
This computation is pretty slow.  The conversion to bfloat of that
rational number is quite fast.

I like this method because we get exactly one rounding operation and the
result is a close as possible to the actual input.

The only other way I can think of is to compute the result as
bfloat(34/10)*bfloat(10)^5000000.  This is fast, but we get two rounding
operations (34/10) and the multiplication, and then whatever rounding we
get from computing 10^5000000.  Perhaps this is acceptable.

Opinions?

Ray



More information about the Maxima mailing list