Home About
Complex Discrete Logs Compressed Histogram Hash
DIY crypto Fusion
Heterodyne Physics McCoskey Count Sort
Oil Spill Fix Personal Rail
Rational Residue Residue Arithmetic
Reverse Translation Analysis Rotary Engine
Subatomic Energy
Rational Home Floating Point Rational
Polynomial Limitations Residue Arithmetic?
Why Residue Arithmetic? New Solutions
Overflow & Compare Translating
Division Numerator/Denominator
Memory Bandwidth Wider Data Bus

Floating Point Rational

Computers easily understand integer arithmetic, but integer arithmetic has no means of expressing quantities less than one. In real life, these quantities are often very important. Floating point is the usual means of dealing with this problem.

Rational arithmetic is known to have superior accuracy but it is slow in a purely polynomial system, because it usually requires a multiply to equalize the denominators of two fractions so that they can be added. Addition and multiplication in residue arithmetic take about the same amount of time and they are both faster than addition in polynomial or floating point. In a residue system, pure rational arithmetic can be done in about the same amount of time as floating point and the accuracy is much greater. And it is now possible to do approximate rational arithmetic that is much faster than floating point and is still more accurate.

Floating point can be considered a limited form of rational arithmetic. It is limited to integers or fractions that have as a denominator a power of the constant radix on which the floating point number system is based. This could be two for binary, 10 for decimal, or 16 for hexadecimal. Other choices are theoretically possible but not usually encountered.

In the decimal system .667 translates to the rational fraction 667/1000. Most of us would recognize this as a usual approximation for the fraction 2/3. The number 2/3 cannot be exactly translated into the decimal system. As a matter of fact any fraction whose denominator has prime factors other than two or five cannot be directly translated into the decimal system. An approximation must be formed, meaning a loss of accuracy. Most computers, use binary floating point which is even more restricted. Binary floating point can only accurately express fractions whose denominators are an exact power of two. Using binary floating point, any fraction whose denominator is not one of these powers of two cannot be accurately rendered, and this is true not only for large numbers but for small ones as well. 1/3, 2/5, 7/11, and 5/6 are all examples of numbers that cannot be accurately represented in binary floating point. The "round off" error introduced is very small and is of no import in most applications, but can be important to scientist. Numbers that can't be represented exactly in binary floating point far exceed those than can.

The inaccuracies introduced by the inability of binary floating point to represent denominators not evenly divisible by two are small, but each inaccuracy introduces by calculations can multiply over time as many calculations are done whose results depend on previous results.

Consider a rational residue computer capable of handling 64 bits each in a numerator and denominator processor. Two to the 64th is a little bit more than 18,000,000,000,000,000,000. This means that any rational fraction with a numerator and denominator less than 18,000,000,000,000,000,000 would be able to be exactly represented in this computer. Such a computer would be considerably more accurate than present binary floating point systems, and unlike present computers, could be programmed to maximize either accuracy or speed. Some very expensive computers do not handle many calculations as accurately as kids doing ordinary grade school arithmetic. A better alternative is at hand, it just needs to be built.

The accuracy of most computers exceeds that needed for most business problems, but that is far from the case in most scientific or engineering situations. If a computer is doing millions of calculations, and each calculation depends on the results of all the proceeding steps, then accuracy is a very major concern, and this exactly describes the situation in the numerical solution of complex systems of differential equations employed by scientists and engineers in almost all disciplines. And such software will probably be used more and more by non-scientist, and even non-technical people. In the present computational environment, programmers have to be constantly on their guard to prevent these accuracy problems from turning a 20 million dollar supercomputer into a random number generator. Accuracy limitations prevent many problems from being solved and make the solution of problems that can be solved much more difficult.