cortex-js / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
https://cortexjs.io
MIT License
366 stars 43 forks source link

x+x does not simplify to 2x #178

Open andrew-murdza opened 3 months ago

andrew-murdza commented 3 months ago

Code

    import { ComputeEngine } from 'https://unpkg.com/@cortex-js/compute-engine?module';
    const ce = new ComputeEngine();
    const expr1 = ce.parse('x+x', { canonical: false });
    const simplifiedExpr1 = expr1.simplify();
    console.log(simplifiedExpr1.toString());

Actual Behavior

x+x

Expected Behavior

2x

andrew-murdza commented 3 months ago

Bugs that are harder to fix

Logs

Negative Signs

Properties of Exponents

Other Powers

Infinity

Miscellaneous

Trig