202110111106 Approximations compose poorly
Approximations do not hold up to composition with other approximations. The error of approximation is magnified when we combine them so that the total error becomes egregiously large.
Here's a simple example with basic math
2.00 ~= 1.99
2.00 ^ 2 = 4.00
1.99 ^ 2 = 3.96
2.00 ^ 3 = 8.00
1.99 ^ 3 = 7.88
You can see how the error is growing much larger after combining multiple approximate values.
In programming, this can be devious. We're not always sure where approximations will come in to play (including things like floating point precision problems).
Haskell offers a unique way around this problem with its laziness characteristic. Since things are evaluated lazily, we can specify a representation of infinite precision for our approximations and the precision we need at the end and Haskell will evaluate all our approximations to the necessary precision to get a correct precision in the outcome.1
-
Jelvis, T. (2015, June 17). Thinking with Laziness. Begriffs. https://begriffs.com/posts/2015-06-17-thinking-with-laziness.html ↩