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

Function sumTermsX

src/compute-engine/rubi/rubi-utils.ts:1587–1594  ·  view source on GitHub ↗

flatten a sum into its terms (Add/Subtract/Negate normalized)

(u: Expression)

Source from the content-addressed store, hash-verified

1585
1586/** structural monomial split u = coef·x^exp (coef and exp x-free; exp may
1587 * be symbolic). No expansion — mirrors Mathematica's literal matching of
1588 * a_.*x_^n_. terms over CE canonical form (Divide/Negate/Sqrt present). */
1589function monoPartsX(
1590 u: Expression,
1591 x: string
1592): { coef: Expression; exp: Expression } | null {
1593 const ce = u.engine;
1594 if (!u.has(x)) return { coef: u, exp: ce.Zero };
1595 if (u.symbol === x) return { coef: ce.One, exp: ce.One };
1596 const ops = u.ops;
1597 if (!ops) return null;

Callers 4

sumBaseTermsFunction · 0.85
monoClassesXFunction · 0.85
binomialPartsXFunction · 0.85
trinomialPartsXFunction · 0.85

Calls 2

mapMethod · 0.65
negMethod · 0.65

Tested by

no test coverage detected