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

Function traceMatches

src/compute-engine/boxed-expression/solve.ts:2171–2183  ·  view source on GitHub ↗
(
      matches: RuleSteps,
      via?: { because: string; form: Expression }
    )

Source from the content-addressed store, hash-verified

2169 * Examples: `(ln x)² − 4 → ln x = ±2 → {e², e⁻²}`,
2170 * `√(ln x) = ln√x → {1, e⁴}`, `e^{2x} − 3e^x + 2 → {0, ln 2}`.
2171 *
2172 * Returns `null` when no single generator captures every occurrence of `x`
2173 * (e.g. `sin x − tan x`, which has two independent generators), or when the
2174 * reduced equation has no roots.
2175 */
2176function solveByGeneratorSubstitution(
2177 expr: Expression,
2178 x: string,
2179 depth: number,
2180 trace?: RuleSteps
2181): ReadonlyArray<Expression> | null {
2182 if (depth >= 3) return null; // recursion backstop
2183 const ce = expr.engine;
2184
2185 const normalized = expandLogPowers(expr);
2186 for (const g of collectGenerators(normalized, x)) {

Callers 1

findUnivariateRootsFunction · 0.85

Calls 3

traceStepFunction · 0.85
asEquationFunction · 0.85
rootsAsEquationsFunction · 0.85

Tested by

no test coverage detected