cortex-js / compute-engine

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

Implement logarithms with bases other than E [FEATURE] #184

Open andrew-murdza opened 2 months ago

andrew-murdza commented 2 months ago

\log_c should be interpreted as a log with base c

Relevant simplification rules

Undefined

Simple

Log Properties

Change of Base

Base of C

Infinity

arnog commented 2 months ago

log of arbitrary base should already be handled through canonicalization.

Do those represent cases that don’t work even though they should or is it just a placeholder list of possible simplifications? Could you check which ones are actually necessary?

You could also submit a PR with corresponding test cases. The relevant file should be test/compute-engine/simplify.test.ts

andrew-murdza commented 2 months ago

I just checked and the are actually recognized by MathJSON. I had assumed that log_2 was not implemented because none of the log simplification rules worked for it. I will work on that. I will make the PR once the custom simplification rules can be implemented (it is a different bug)