4 ms·
The other posters are right, double double and quad doubles. The way to think of them is for a real number r, a double d(r) is the closest value storable in a
by ChrisLomont 6y ago
The other posters are right, double double and quad doubles.
The way to think of them is for a real number r, a double d(r) is the closest value storable in a double, but there may be some error between the real value and the floating-point approximation.
Store that in another double, called dd(r) = r-d(r), and it will have a smaller exponent, but most importantly, it gives you twice as many bits of precision.
Then carefully make +-*/ operations, and you're off to the races.
I've implemented them from scratch on many platforms over the years, often to do deep mandelbrot runs, since they have really good performance for the between double and arbitrary precision libraries.
But it's always the same idea: one double as normal, and another double to represent the difference between the value you care about and the double that represents the higher order bits.