Skip to content

TD Cascade: Triple-Double Precision

Sometimes double-double (~31 decimal digits) is not enough, but quad-double (~64 digits) is more than you need. Triple-double fills the gap: ~47 decimal digits using three doubles, at roughly 75% of the cost of quad-double. This precision tier is particularly useful for intermediate computations where you need more than DD for accumulation accuracy but don’t want to pay the full QD cost.

td_cascade wraps floatcascade<3>:

PropertyValue
Components3 doubles
Total bits192
Significand~159 bits (~47.8 decimal digits)
Epsilon~1.39 × 10^-48
Frameworkfloatcascade<3>
  • Triple the precision of double: 159-bit significand
  • Intermediate tier: fills the gap between DD (106 bits) and QD (212 bits)
  • Unified cascade API: same interface as dd_cascade and qd_cascade
  • Memory efficient: 24 bytes vs QD’s 32 bytes
  • Same dynamic range as double: 10^-308 to 10^308
TypeDecimal DigitsStorageRelative Cost
double15.98 bytes1x
dd_cascade31.416 bytes~10x
td_cascade47.824 bytes~25x
qd_cascade63.832 bytes~50x
#include <universal/number/td_cascade/td_cascade.hpp>
using namespace sw::universal;
td_cascade a("3.14159265358979323846264338327950288");
td_cascade b("2.71828182845904523536028747135266249");
td_cascade product = a * b;
std::cout << std::setprecision(48) << product << std::endl;
// Accurate to ~47 decimal digits
// When DD accumulation isn't precise enough but QD is overkill
td_cascade sum(0.0);
for (int i = 1; i <= 10000000; ++i) {
sum += td_cascade(1.0) / td_cascade(i);
}
// Harmonic series sum with ~47 digits of accuracy
ProblemHow td_cascade Solves It
DD’s 31 digits insufficient, QD’s 64 digits wasteful47 digits: the right precision for the problem
Need more than DD for accumulation in iterative methodsTriple precision prevents error accumulation
Memory-constrained extended precision24 bytes vs QD’s 32 bytes (25% savings)
Consistent API across precision levelsSame interface as dd_cascade and qd_cascade