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

Function recanonicalize

src/compute-engine/rubi/normal-form.ts:231–237  ·  view source on GitHub ↗
(ce: ComputeEngine, e: Expression)

Source from the content-addressed store, hash-verified

229 * arithmetic produces unfolded artifacts (e.g. `a + 0·b`).
230 */
231export function recanonicalize(ce: ComputeEngine, e: Expression): Expression {
232 if (e.symbol || !e.ops) return e;
233 return ce.function(
234 e.operator,
235 e.ops.map((o) => recanonicalize(ce, o))
236 );
237}
238
239function leafCountOf(e: Expression): number {
240 if (!e.ops) return 1;

Callers 4

intUncachedMethod · 0.90
dispatchMethod · 0.90
collectFunction · 0.90

Calls 2

functionMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected