mixle.engines.spectrum module¶
The precision spectrum’s front door: route a computation to the CHEAPEST backend that is accurate.
Ties the spectrum together – native float64, double-double (mixle.engines.extended), and the MPFR
tail (mixle.engines.highprec) – behind one call that reads the certified error bound
(mixle.engines.error_tracing) and escalates only as far as the accuracy budget demands. This is
‘use logic to preserve numerical accuracy with minimal compute’ as an actual API: a well-conditioned sum
stays in fast float64, a cancelling one steps up to vectorized double-double, and only a catastrophically
ill-conditioned one pays for arbitrary precision.
- accurate_sum(x, target_rel_error=1e-12)[source]
Sum
xtotarget_rel_errorrelative accuracy using the cheapest sufficient backend.Returns
(value, backend)wherebackendis"float64","dd"(double-double), or"mpfr<bits>". Escalates only when the certified error bound says the cheaper backend cannot meet the budget – so the common (well-conditioned) case never leaves vectorized float64.
- sum_certificate(x)[source]
Report the certified float64 summation error and the condition number, without choosing a backend.