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

Function sameValue

test/compute-engine/factor.test.ts:267–271  ·  view source on GitHub ↗
(a: Expression, b: Expression)

Source from the content-addressed store, hash-verified

265 // factorPolynomial must return a fully-factored, prime-power form so that
266 // partial-fraction decomposition sees irreducible factors. extractContent
267 // only handled the numeric GCD, and pre-factored Multiply/Power inputs were
268 // never recursed into — so x³+x² and x·(x²+x) came back unfactored.
269 const sameValue = (a: Expression, b: Expression) => {
270 for (const xv of [2, -3, 5, 0.7]) {
271 expect(a.subs({ x: xv }).N().re).toBeCloseTo(b.subs({ x: xv }).N().re);
272 }
273 };
274

Callers 1

factor.test.tsFile · 0.85

Calls 2

NMethod · 0.65
subsMethod · 0.65

Tested by

no test coverage detected