MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / realRootValues

Function realRootValues

benchmarks/runners/run_ce.mjs:67–76  ·  view source on GitHub ↗
(roots)

Source from the content-addressed store, hash-verified

65// Numeric real parts of a list of boxed roots, keeping only the (near-)real
66// ones. A complex root's `.N()` exposes `.im`; we drop |im| above a tolerance.
67function realRootValues(roots) {
68 const out = [];
69 for (const r of roots ?? []) {
70 const v = r.N();
71 const re = typeof v.re === 'number' ? v.re : Number(v.toString());
72 const im = typeof v.im === 'number' ? v.im : 0;
73 if (Number.isFinite(re) && Math.abs(im) < 1e-7) out.push(re);
74 }
75 return out;
76}
77
78// An `evaluate` result is "unevaluated" if it still carries the operator head
79// (Limit/Integrate/Sum) or prints one — i.e. no closed form was found.

Callers 1

run_ce.mjsFile · 0.70

Calls 4

NMethod · 0.65
toStringMethod · 0.65
absMethod · 0.65
isFiniteMethod · 0.45

Tested by

no test coverage detected