Cortex Compute Engine
Symbolic manipulation and numeric evaluation of MathJSON expressions
MathJSON is a lightweight mathematical notation interchange format based on JSON.
The Cortex Compute Engine can parse LaTeX to MathJSON, serialize MathJSON to
LaTeX, format, simplify and evaluate MathJSON expressions.
Reference documentation and guides at
cortexjs.io/compute-engine.
Using Compute Engine
$ npm install --save @cortex-js/compute-engine
import { parse, evaluate } from '@cortex-js/compute-engine';
const expr = parse('2^{11}-1 \\in \\P');
console.log(expr);
console.log(evaluate(expr));
More
Related Projects
- MathJSON
- A lightweight mathematical notation interchange format
- MathLive (on GitHub)
- A Web Component for math input.
- Cortex (on GitHub)
- A programming language for scientific computing
Support the Project
License
This project is licensed under the MIT License.
0.18.1 2023-10-16
Issues Resolved
- Parsing of whole numbers while in
rational
mode would return incorrect
results.
- The
ND
function to evaluate derivatives numerically now return correct
values.
ce.parse("\\mathrm{ND}(x \\mapsto 3x^2+5x+7, 2)").N();
// -> 17.000000000001
Improvements
- Speed up
NIntegrate
by temporarily switching the numeric mode to machine
while computing the Monte Carlo approximation.