3 ms·
Yes! And no! You will indeed need higher precision if you need a very large number of digits (more than what double precision gives you). However, even with h
by nestorD 2y ago
Yes! And no!
You will indeed need higher precision if you need a very large number of digits (more than what double precision gives you).
However, even with high precision, the algorithms you use to compute your moments matter: you might not have as many digits as you hope for. Variance, for example, is famously numerically unstable (sometimes giving a negative variance) when computed naively. A stable summation algorithm plugged into a variance computation (even a carefully written one) can sometimes give you six additional digits of precision in the variance that you might not get when doubling the precision (it depends on how big of a cancellation you had in your operations; too big, and doubling the precision will not be enough to recover, while a compensated summation would do fine).
I have seen this play out once in a clustering algorithm that would only work on some data when using a compensated summation to compute the variance.
- credit_guy 2y agoWell, my point is that it's not as easy as saying "just pick a smarter algorithm". Not all problems needing high precision can resort to a smart summation. Sometimes that smart algorithm just doesn't exist yet. You are also right, that if you can solve your problem with high precision, it's unlikely that just quad precision will be enough. For example the inverse Laplace transform. In some cases you need thousands of digits. The cases where double precision is not enough, but quad precision is are probably rare. But it's worth a try.