[sdiy] Harmonic bandwidth

Rainer Buchty rainer at buchty.net
Thu Jan 10 11:51:33 CET 2008


On Wed, 9 Jan 2008, Tom Wiltshire wrote:

> Yes, I'd have thought so too. All this talk of floating-point errors 
> sounds pretty fanciful to me. Human ears aren't THAT good!

Never underestimate the size of floating-point errors. Just some quick 
examples:

(1) 10^20 +    17 -    10 +   130 - 10^20
(2) 10^20 -    10 +   130 + 10^20 +    17
(3) 10^20 +    17 - 10^20 -    10 +   130
(4) 10^20 -    10 - 10^20 +   130 +    17
(5) 10^20 - 10^20 +    17 -    10 +   130    
(6) 10^20 +    17 +   130 - 10^20 -    10

Calculating sequentially with IEEE-style double-precision floating-point 
arithmetic will give you astonishing results, i.e. 0, 17, 120, 147, 137 
and -10 -- only (5) will produce the correct result. In (6), not even 
the sign is correct.

Things may go even worse when targeting scalar products.

There's a nice book ("Advanced Arithmetic for the Digital Computer: 
Design of Arithmetic Units" by Ulrich Kulisch, Springer, 2002, ISBN 
3-211-83870-8) which deals with these problems and also shows solutions. 

(I assume that e.g. Matlab uses such techniques as it IIRC does not 
necessarily rely on FPU hardware but uses own high-precision software 
routines.)

> You can push a calculation on a computer pretty hard before you even 
> hit integer limit errors, and I don't think I've ever managed to 
> really stretch floating-point to breaking point, much less double 
> precision.

See above.

> Not saying it can't happen, but it's not where I'd start looking.

It depends. As long as you not approach the "borders" of the 
floating-point format, you're fine. But *if* you either go into very 
small or very high numbers prepare for problems.

Rainer



More information about the Synth-diy mailing list