[sdiy] Accuracy with integer maths
Tom Wiltshire
tom at electricdruid.net
Tue Feb 4 15:00:15 CET 2014
Hi All,
Does anyone know any good websites where I can learn about accuracy requirements in integer maths?
Specifically, I'd like to know how many bits I need to calculate for various algorithms; multiplication, interpolation, etc.
I've been doing some experiments and they suggest to me that I need more bits than I'd expected to eliminate errors. For example, if I take two 8-bit integers and multiply them, I get a 16-bit result. If I'm only interested in (say) the top 10 bits of that result, do I need to calculate the full 8x8 multiplication? Can I eliminate some of the calculation without getting any errors?
What about if I needed 12 bits? Or what about if I were treating one 8-bit value as a 0 -> 0.99 amount value, and I multiply by the other 8-bit value and then use only the top 8 bits of the result.
If anyone knows anywhere where there is a clear, programmer-orientated explanation of this sort of stuff, I'd be grateful. A serious academic number-theory treatment probably won't get through to me, since I'm not a (remotely!) serious academic or a number theoretician.
Thanks!
Tom
More information about the Synth-diy
mailing list