Post Reply 
I->R and R->I without (rounding) errors
08-05-2021, 12:51 AM
Post: #12
RE: I->R and R->I without (rounding) errors
Another (slow) but as exact as possible is to work with fractions. David Matula wrote some papers on this method back in the 1960s. Multiplication and division are easy but the numbers can get a bit long. Addition and subtraction are longer, A/B + C/D=(AD+BC)/(BD). In all cases, the result should be in lowest terms. In all cases, the size of the numbers gets really big.

The trick is to pick limits for numerators and denominators (these can be different for different terms in the problem even; some things may get a more precise treatment. A useful approximation is that A/B may be approximated by a sequence of fractions: a1/b1, a2/b2,...ak/bk; where the (unique) sequence of fractions satisfies: | A/B - aj/bj | < 1/bj**2

What is nice, is that there are theorems showing some long computations always remain within "nice" bounds. The system has been used to do linear algebra on fractions. In some cases, a result may be known to be an integer but floating-point computation may give zero and the rational (even with the reduction of intermediates) works well.

I've used this a bit working on problems with algebraic numbers (mostly quadratic) by keeping some of the work as symbolic (Sqrt(8)=2*Sqrt(2) with later approximation) and using continued fractions for the rest.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: I->R and R->I without (rounding) errors - ttw - 08-05-2021 12:51 AM



User(s) browsing this thread: 1 Guest(s)