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

Function serializeD

test/compute-engine/explain.test.ts:659–669  ·  view source on GitHub ↗
(
  latex: string,
  options?: { variable?: string }
)

Source from the content-addressed store, hash-verified

657): { initial: string; result: string; steps: string[] } {
658 const ex = ce.parse(latex).explain('D', options);
659 return {
660 initial: ex.initial.toString(),
661 result: ex.result.toString(),
662 steps: ex.steps.map((s) => `${s.id}: ${s.value.toString()}`),
663 };
664}
665
666describe('explain: golden D explanations', () => {
667 test('x sin(x): product rule + known derivative', () => {
668 const ex = ce.parse('x \\sin x').explain('D');
669 expect(ex.steps.some((s) => s.id === 'derivative.product-rule')).toBe(true);
670 expect(ex.steps.some((s) => s.id === 'derivative.known-derivative')).toBe(
671 true
672 );

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