import { describe, expect, it } from '@jest/globals'; import { eCompress, eEstimate } from 'big-float-ts'; import { toCasStr } from '../../../src/basic/to-cas-str.js'; import { getPolys_BezierIntersections } from '../../get-poly.js'; import { roots } from '../../../src/roots/descartes/roots.js'; import { Poly } from '../../poly.js'; import { ddMultiply } from '../../../src/basic/double-double/dd-multiply.js'; import { eMultiply } from '../../../src/basic/expansion/e-multiply.js'; const { round, ceil, abs, log2, max } = Math; function testIt_HighDeg() { // find roots within a typical range const lb = 0; const ub = 2**0; // find roots on the entire projective number line // const lb = -Infinity; // const ub = Infinity; /** number of polynomials to find roots of */ // const N = 100_000; const N = 1; // const M = 20; // (10*M - 1) degree polynomials const M = 2; const shift = 0; //------------------------------------------------------------------ // create intersection polynomials from the generated cubic beziers //------------------------------------------------------------------ const polys: Partial[] = []; const _polys = getPolys_BezierIntersections(N*M, shift).map(p => { const pDd = p.pDd; const pE = p.getPExact(); const maxAbs = max(...pDd.map(c => c[1])); const s = 2**-(ceil(log2(abs(maxAbs))));//? return { pDd: pDd.map(dd => dd.map(v => v*s*2**2)), pE: pE.map(coef => coef.map(v => v*s*2**2)), } }); _polys[0];//? for (let i=0; i 0); polys.push({ pDd: polyDd, pDd_, getPExact: () => polyE }); } polys[0].getPExact!();//? // throw 'a'; //------------------------------------------------------------------ // find all roots of all generated polynomials using `isolateRoots` //------------------------------------------------------------------ let numIso = 0; const timeStartIso = performance.now(); for (let i=0; i