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

Function sumSimplerAuxQ

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

Rubi SumSimplerAuxQ — recursion over (expanded) sum terms: * - v a sum: every term of v is rational or aux-simpler wrt u * - u a sum: some term of u is aux-simpler wrt v * - both terms: v ≠ 0, same non-numeric factors, and the numeric-factor * ratio nf(u)/nf(v) < −1/2 (or = −1/2 with nf(u) < 0

(u: Expression, v: Expression)

Source from the content-addressed store, hash-verified

517function ratParts(e: Expression): [number, number] | null {
518 if (!isLiteralRational(e)) return null;
519 const num = e.numerator.re;
520 const den = e.denominator.re;
521 if (typeof num !== 'number' || typeof den !== 'number') return null;
522 return [num, den];
523}
524
525/** Rubi NumericFactor/NonnumericFactors split of a term: the leading
526 * rational coefficient and the remaining (non-numeric) factors. */
527function splitNumericFactor(u: Expression): {
528 coef: number;
529 rest: Expression;
530} {
531 const ce = u.engine;
532 const r = ratParts(u);
533 if (r) return { coef: r[0] / r[1], rest: ce.One };

Callers 1

rubi-utils.tsFile · 0.85

Calls 3

isLiteralRationalFunction · 0.85
splitNumericFactorFunction · 0.85
isSameMethod · 0.65

Tested by

no test coverage detected