Recurrences converging to the wrong limit in finite precision (2020) [pdf]
etna.math.kent.edu
etna.math.kent.edu
Just to clarify (as the paper does make this distinction) when I say "correct" here I mean the mathematical sense, not the correctly rounded value from floating point arithmetic.
Maybe some day we'll invent computers that are good at math.
IEEE-754 is actually quitte good at what it does (fast computations, on numbers covering a wide range, while staying accurate accross a large number of operations despite being encoded in finite precision) but it is not real number and it might not be optimal for a given application (maybe you want perfect precision and don't care about speed, maybe you want speed and don't care that much about the result: IEEE-754 is somewhere in the middle, used by people who care enough about speed to run their code on supercomputers and want precision good enough to predict whether their plane will fly given the simulation results).
There is no good general representation for irrational numbers, though.
And our ability to run numeric stuff like integration or gradient descent is limited to integers and floating-point approximations of real numbers.
To do a rational with arbitrary factors like 11 on the bottom is a hassle because the denominator almost always gets bigger when you do math
11/2 + 61/11 = 243/22
I have been thinking about writing a program that uses interval math to generate fractal pictures, hoping I can somehow improve the image quality enough to reveal the structure of the chaotic areas of Hamiltonian maps.For instance you can represent integers as binary, base 3, BCD, or any base and they are still the same integers. That is you can write the same number 75412 in any of those systems. The notation for the number is different but the same numbers exist in all of those systems.
Floats on the other hand are a subset of rationals. In the case of binary floats the denominator is 2^N, in the case of decimal floats it is 10^N.
In this case it is not just a difference of notation. The number 1/4 exists in both the decimal and binary floats, but 1/10 exists in the decimal floats but not the binary floats. Thus you have the problem
0.1 + 0.2 != 0.3
because (a) none of the numbers involved really exist in the floats, (b) if you ask for 0.1 you get some other number that is close to 0.1 and prints out as 0.1 but, (c) isn't really 0.1 so what should be an equality is an inequality.You could represent the mantissa (the numerator) of decimal floats with base 2 or base 10 which makes a difference in coding efficiency, how fast calculations are, how fast decimal input/output are, etc. It's the base 2 vs base 10 exponent that makes binary floats appear defective.
And in particular, decimal floating point usually encodes numbers as either fully binary, or in batches of 10 binary bits that hold 3 digits each.
IBM implements it in hardware on their big computers.