quaeratin
Version:
An extended precision floating point library (as per Shewchuk) - precision only limited by overflow / underflow
20 lines (19 loc) • 781 B
TypeScript
/**
* Returns the product of two double floating point expansions.
*
* * see [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf)
*
* As per Shewchuk in the above paper: "To find the product of two expansions
* e and f, use SCALE-EXPANSION (with zero elimination) to form the expansions
* ef_1, ef_2, ..., then sum these using a distillation tree."
*
* A distillation tree used with fastExpansionSum will give O(k*log k) vs O(k^2)
* operations.
*
* Implemented naively and not as described by Shewchuk (i.e. the algorithm
* takes O(k^2) operations).
* @param e a double floating point expansion
* @param f another double floating point expansion
*/
declare function expansionProduct(e: number[], f: number[]): number[];
export { expansionProduct };