3 ms·
Sure, but: 1) As soon as you wrap it in a Python class, much of that speed advantage goes away. 2) Double-double doesn't solve the problem with the limited ex
by fdej 11y ago
Sure, but:
1) As soon as you wrap it in a Python class, much of that speed advantage goes away.
2) Double-double doesn't solve the problem with the limited exponent range of doubles.
3) When the goal is to allow setting the precision to any number of bits you like, having a separate implementation for X bits complicates things a lot, especially when the X-bit arithmetic doesn't quite behave like Y-bit arithmetic for X != Y (double-double behaves somewhat differently from 108-bit floating-point).
IMO, double-double would be most interesting as a NumPy extension.
- pklausler 11y agoFair enough, although I've always (well, since 1980) been skeptical that an exponent range from 10E-307 to 10E+308 fails to suffice for any real problem. I mean, come on, there's only something like 10E+80 atoms in the universe.
- fdej 11y agoVery large or small numbers are useful in combinatorics and number theory. It can also happen that they are needed for intermediate steps in an algorithm, even when the inputs and outputs are moderate (the same reason that 15 digits sometimes isn't enough even when you just want 3 digits of output). Granted, you can generally work around exponent range limitations using tricks (scaling values properly or introducing logarithms), but that can obviously be a hassle.