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

Function monomialQ

src/compute-engine/rubi/rubi-utils.ts:1212–1223  ·  view source on GitHub ↗
(u: Expression, ctx: Ctx)

Source from the content-addressed store, hash-verified

1210 cmp: (a: number, b: number) => boolean
1211): boolean {
1212 const u = build(args[0], ctx).evaluate();
1213 if (!isLiteralInteger(u)) return false;
1214 const a = realNum(u);
1215 const b = realNum(build(args[1], ctx));
1216 return a !== null && b !== null && cmp(a, b);
1217}
1218
1219// Rubi PosAux (sign heuristic): numbers by value; symbols positive;
1220// products multiply signs; sums take the first term; even powers positive.
1221function posAux(u: Expression): boolean {
1222 const r = realNum(u);
1223 if (r !== null) return r > 0;
1224 const n = u.N();
1225 if (isNumber(n) && typeof n.re === 'number' && typeof n.im === 'number') {
1226 return n.re !== 0 ? n.re > 0 : n.im > 0;

Callers 1

rubi-utils.tsFile · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected