[HN Gopher] Taming Floating-Point Sums
___________________________________________________________________
Taming Floating-Point Sums
Author : todsacerdoti
Score : 17 points
Date : 2024-05-25 20:28 UTC (2 hours ago)
(HTM) web link (orlp.net)
(TXT) w3m dump (orlp.net)
| nsajko wrote:
| I recommend the "Handbook of Floating-point Arithmetic" if this
| piques interest. I think it's freely available on HAL.
| greenyoda wrote:
| I found the link to it on HAL, but clicking "Consult the full
| text" only seems download the table of contents and preface:
| https://hal.science/hal-01766584
|
| A new copy costs $112 on Amazon:
| https://www.amazon.com/Handbook-Floating-Point-Arithmetic-Je...
| Infinity315 wrote:
| A method which this article doesn't mention is stochastic
| rounding or probabilistic rounding.
|
| Rather than striving for exact values for every computation, we
| make it so that the expected value is exact. For example, suppose
| our number system was restricted to the integers and we have
| incoming value 1.1, with stochastic rounding we'd round down to 1
| 90% of the time and 2 10% of the time giving an expected value of
| 1.1!
|
| Further reading:
|
| https://nhigham.com/2020/07/07/what-is-stochastic-rounding/
| orlp wrote:
| Interesting, I haven't seen that before in the context of
| numerics.
|
| It is used all the time however in audio and image processing,
| where it is called dithering.
| caturopath wrote:
| The motivating example is a mess. 15_000_000 would have been a
| less distracting example, as this one has more-visible problems
| unrelated to the problem they're trying to solve. (Further, with
| default options, the opening example won't have the result shown:
| it will crash your program.)
| orlp wrote:
| I don't follow. Why is 15_000_000 less distracting? What
| problems unrelated to what we're trying to solve? And what
| 'default options' are you referring to?
___________________________________________________________________
(page generated 2024-05-25 23:00 UTC)