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

Function mmaTermKey

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

sorted symbol leaves of a term, reversed (MMA compares monomials from * their trailing factor)

(e: Expression)

Source from the content-addressed store, hash-verified

1145// Rubi PosAux (sign heuristic): numbers by value; symbols positive;
1146// products multiply signs; sums take the first term; even powers positive.
1147function posAux(u: Expression): boolean {
1148 const r = realNum(u);
1149 if (r !== null) return r > 0;
1150 const n = u.N();
1151 if (isNumber(n) && typeof n.re === 'number' && typeof n.im === 'number') {
1152 return n.re !== 0 ? n.re > 0 : n.im > 0;
1153 }
1154 if (u.symbol) return true;
1155 if (u.operator === 'Power' && u.ops) {
1156 const e = u.ops[1];

Callers 1

mmaFirstTermFunction · 0.85

Calls 1

collectSymbolLeavesFunction · 0.85

Tested by

no test coverage detected