double-double
Version:
Pure double-double precision functions *with strict error bounds*.
18 lines • 532 B
JavaScript
import { ddMultDd } from "../binary/dd-mult-dd.js";
/**
* Returns the result of multiplying together an array of double-double-precision
* floating point numbers naively (i.e. not using pairwise addition to reduce
* error a bit).
*
* * an error bound is given by: (n-1)(1+ϵ),
* where ϵ <= 7u^2, u = 0.5 * Number.EPSILON
*/
function ddProduct(qs) {
let q = qs[0];
for (let i = 1; i < qs.length; i++) {
q = ddMultDd(q, qs[i]);
}
return q;
}
export { ddProduct };
//# sourceMappingURL=dd-product.js.map