Maths error

Nick Maclaren nmm1 at cus.cam.ac.uk
Sun Jan 14 06:54:52 EST 2007


In article <mailman.2713.1168771289.32031.python-list at python.org>,
"Hendrik van Rooyen" <mail at microcorp.co.za> writes:
|>  "Tim Peters" <tim.one at comcast.net> wrote:
|> 
|> > What you will still see stated is variations on Kahan's telegraphic 
|> > "binary is better than any other radix for error analysis (but not very 
|> > much)", listed as one of two techincal advantages for binary fp in:
|> > 
|> >     http://www.cs.berkeley.edu/~wkahan/MktgMath.pdf

Which I believe to be the final statement of the matter.  It was a minority
view 30 years ago, but I now know of little dissent.

He has omitted that mid-point invariant as a third advantage of binary,
but I agree that it could be phrased as "one or two extra mathematical
invariants hold for binary (but not very important ones)".

|> My basic error of thinking ( ? - more like gut feel ) was that the
|> bigger bases somehow lose "more bits" at every round, 
|> forgetting that half a microvolt is still half a microvolt, whether
|> it is rounded in binary, decimal, or hex...

That is not an error, but only a mistake :-)

Yes, you have hit the nail on the head.  Some people claimed that some
important algorithms did that, and that binary was consequently much
better.  If it were true, then the precision you would need would be
pro rata to the case - so the decimal equivalent of 64-bit binary would
need 160 bits.

Experience failed to confirm their viewpoint, and the effect was seen
in only artificial algorithms (sorry - I can no longer remember the
examples and am reluctant to waste time trying to reinvent them).  But
it was ALSO found that the converse was not QUITE true, either, and the 
effective numerical precision is not FULLY independent of the base.

So, at a wild guesstimate, 64-bit decimal will deliver a precision
comparable to about 56-bit binary, and will cause significant numerical
problems to a FEW applications.  Hence people will have to convert to
the much more expensive 128-bit decimal format for such work.

Bloatware rules.  All your bits are belong to us.


Regards,
Nick Maclaren.



More information about the Python-list mailing list