cortex-js / compute-engine

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

e·e^x·e^{-x} not simplified #176

Open holgerengels opened 4 weeks ago

holgerengels commented 4 weeks ago

Description

Expected simplification does not take place

Steps to Reproduce

ce.parse("ee^xe^{-x}").simplify() produces: ["Multiply","ExponentialE",["Power","ExponentialE","x"],["Power","ExponentialE",["Negate","x"]]] expected: ExponentialE

Version: "@cortex-js/compute-engine": "^0.25.0" Operating System Linux 6.8.0-35

andrew-murdza commented 3 weeks ago

It turns out that ee^x doesn't work either. The problem occurs when one of the factors doesn't have an exponent or has an exponent of 1. It also doesn't work for 2^x2 and 2^x2^1 for example.