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

Function posQ

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

Rubi PosQ[u] := PosAux[TogetherSimplify[u]] — the Together step is * semantic, not cosmetic: PosAux[a − bc/d] has First = a (positive form) * while the together'd (a·d − b·c)/d has First = −b·c (negative form). * Emulated with the asNumDen/expand rational normalizer.

(e: Expression)

Source from the content-addressed store, hash-verified

1120 // Mathematica's automatic Together would have flattened)
1121 const vals = args.map((a) => {
1122 const e = build(a, ctx);
1123 return realNum(e) ?? realNum(safeSimplify(e)) ?? ratConstant(e);
1124 });
1125 for (let i = 0; i + 1 < vals.length; i++) {
1126 const a = vals[i];
1127 const b = vals[i + 1];
1128 if (a === null || b === null || !cmp(a, b)) return false;
1129 }
1130 return true;
1131}
1132
1133function intCmp(

Callers 6

rubi-utils.tsFile · 0.85
negFormQFunction · 0.85
rtAuxBodyFunction · 0.85
genBinomialPartsXFunction · 0.85
genTrinomialPartsXFunction · 0.85
simplerSqrtQFunction · 0.85

Calls 4

expandFunction · 0.90
asNumDenFunction · 0.85
posAuxFunction · 0.85
isSameMethod · 0.65

Tested by

no test coverage detected