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

Function serializeExplanation

test/compute-engine/explain.test.ts:149–160  ·  view source on GitHub ↗
(latex: string)

Source from the content-addressed store, hash-verified

147// ============================================================
148
149function serializeExplanation(latex: string): {
150 initial: string;
151 result: string;
152 steps: string[];
153} {
154 const ex = ce.parse(latex).explain();
155 return {
156 initial: ex.initial.toString(),
157 result: ex.result.toString(),
158 steps: ex.steps.map((s) => `${s.id}: ${s.value.toString()}`),
159 };
160}
161
162describe('explain: golden explanations', () => {
163 test('(x^2-1)/(x-1): cancel common polynomial factors', () => {

Callers 1

explain.test.tsFile · 0.85

Calls 4

explainMethod · 0.65
parseMethod · 0.65
toStringMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected