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

Function curateChain

src/compute-engine/boxed-expression/explain.ts:148–163  ·  view source on GitHub ↗
(
  initial: Expression,
  trace: RuleSteps,
  verbosity: 'default' | 'all'
)

Source from the content-addressed store, hash-verified

146 const initial = isFunction(canonical, 'Equal')
147 ? canonical
148 : ce.function('Equal', [canonical, ce.Zero]);
149
150 const trace: RuleSteps = [];
151 const roots = findUnivariateRoots(canonical, x, 0, trace);
152 const filtered = filterRootsByAssumptions(ce, roots, x);
153
154 if (filtered.length < roots.length) {
155 const dropped = roots.filter((r) => !filtered.some((f) => f.isSame(r)));
156 trace.push({
157 value: rootsAsEquations(ce, x, dropped),
158 because: 'solve.filter-domain',
159 });
160 }
161
162 if (filtered.length > 0)
163 trace.push({
164 value: rootsAsEquations(ce, x, filtered),
165 because: 'solve.roots',
166 });

Callers 2

explainDFunction · 0.90
explainSolveFunction · 0.85

Calls 3

toExplainStepFunction · 0.85
mapMethod · 0.65
isSameMethod · 0.65

Tested by

no test coverage detected