News for hackers. Stuff that matters.
Re:Improving Floating Point Accuracy: A Look at Sums by SagelyGuru on Monday October 19, 2015 @03:49PM (#10415216)
Good point. To reduce this problem you can (and should?) factorise and cancel out common primes. Just keeping to a pair of 64 bit integers will give you a pretty good accuracy. You can perform all arithmetic directly on the rationals and represent reals by the nearest rational approximation (after all, a float is an approximation too in those cases, just a poorer one).

Stern-Brocot trees are a good systematic way of finding the best rational approximations and also for doing interval rational arithmetic.

There are no comments on this comment yet.