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

Function fix

scripts/rubi/extract-rules.ts:146–159  ·  view source on GitHub ↗
(node: Json)

Source from the content-addressed store, hash-verified

144 // coefficient, and only these rules carry the pattern). Fix: f/e^n → f/g^n.
145 if (filePath.includes('1.1.3.6 (g x)^m')) {
146 const fix = (node: Json): Json => {
147 if (Array.isArray(node)) {
148 if (
149 node[0] === 'Divide' &&
150 node[1] === 'f' &&
151 Array.isArray(node[2]) &&
152 node[2][0] === 'Power' &&
153 node[2][1] === 'e_var'
154 )
155 return ['Divide', 'f', ['Power', 'g', node[2][2]]];
156 return node.map(fix);
157 }
158 return node;
159 };
160 for (const r of rules) r.rhs = fix(r.rhs);
161 }
162}

Callers 1

applyUpstreamCorrectionsFunction · 0.85

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected