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

Function trinomialMatchQ

src/compute-engine/rubi/rubi-utils.ts:2201–2208  ·  view source on GitHub ↗
(u: Expression, x: string)

Source from the content-addressed store, hash-verified

2199 if (classes.length !== 2) return null;
2200 const [c1, c2] = classes;
2201 if (c1.exp.isSame(0) || c2.exp.isSame(0)) return null;
2202 // n is the "larger" exponent (PosQ[n−q])
2203 const nFirst = posQ(safeSimplify(c1.exp.sub(c2.exp)));
2204 const [qc, nc] = nFirst ? [c2, c1] : [c1, c2];
2205 return { a: qc.coef, b: nc.coef, n: nc.exp, q: qc.exp };
2206 }
2207 // unexpanded product s·x^m·v with v (generalized) binomial
2208 const split = splitMonoFactor(u, x);
2209 if (split === null) return null;
2210 const { scale, exp: mExp, rest } = split;
2211 if (rest === null) return null;

Callers 1

rubi-utils.tsFile · 0.85

Calls 5

monoClassesXFunction · 0.85
zeroQFunction · 0.85
isSameMethod · 0.65
subMethod · 0.65
mulMethod · 0.65

Tested by

no test coverage detected