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

Function gcd2

src/compute-engine/boxed-expression/solve.ts:1437–1442  ·  view source on GitHub ↗
(a: number, b: number)

Source from the content-addressed store, hash-verified

1435 * This handles equations like:
1436 * - √(x+1) = x → x² - x - 1 = 0
1437 * - √(2x+3) = x - 1 → x² - 4x - 2 = 0
1438 * - √x = x - 2 → x² - 5x + 4 = 0
1439 *
1440 * Returns the transformed expression if a sqrt-linear pattern is found,
1441 * otherwise returns the original expression unchanged.
1442 *
1443 * Note: Squaring can introduce extraneous roots. The caller should validate
1444 * roots against the original equation using validateRoots().
1445 */

Callers 2

lcm2Function · 0.85

Calls 1

absMethod · 0.65

Tested by

no test coverage detected