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

Function divideForm

src/compute-engine/boxed-expression/canonical.ts:341–350  ·  view source on GitHub ↗

* Apply the 'Divide' form recursively. For `Divide` expressions, operands * are first passed through `powerForm` before being canonicalized via * `canonicalDivide`. This is because division canonicalization benefits from * having power expressions already normalized (e.g., `a / b^{-1}` simplifies

(expr: Expression)

Source from the content-addressed store, hash-verified

339 if (!firstOpShadow?.has(symbolNameOf(op1)) && isImaginaryUnit(op1))
340 return ce.number(ce.complex(0, -1));
341 }
342
343 // Re-box only if some transformation has applied
344 return ops.every((op, index) => op === expr.ops![index])
345 ? expr
346 : ce._fn(name, ops, { canonical: false });
347}
348
349/**
350 * Apply the 'Multiply' form recursively. Each sub-expression is visited
351 * and any `Multiply` or `Negate` at the current level is canonicalized.
352 *
353 * Operands are passed directly to `canonicalMultiply` without calling

Callers 1

canonicalFormFunction · 0.85

Calls 5

isFunctionFunction · 0.90
canonicalDivideFunction · 0.90
powerFormFunction · 0.85
_fnMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected