Open andrew-murdza opened 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
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)
\log_c
should be interpreted as a log with base cRelevant simplification rules
Undefined
{match:\log_c(a),replace:NaN,condition:c==1}
{match:\log_c(a),replace:NaN,condition:c\le 0}
\log_c(0)->NaN
Simple
\log_c(1)->0
\log_c(c)->1
,\log_c(c^a)->a
Log Properties
\log_c(ab)->\log_c(a)+\log_c(b)
\log_c(\frac{a}{b})->\log_c(a)-\log_c(b)
\log_c(\frac{1}{b})=-\log_c(b)
\log_c(c^ab)->a+\log_c(b)
\log_c(\frac{c^a}{b})->a-\log_c(b)
\log_c(\frac{b}{c^a})->\log_c(b)-a
\log_c(b^a)->a\log_c(b)
Change of Base
\log_c(b)\ln(c)->\ln(b)
\frac{\log_c(b)}{\log_d(b)}->\frac{\ln(d)}{\ln(c)}
\log_{1/c}(b)->-\log_c(b)
Base of C
c^{\log_c(a)}->a
c^{b\log_c(a)}->a^b
c^{\log_c(a)+b}->a\cdot c^b
c^{\log_c(a)-b}->\frac{a}{c^b}
c^{d\log_c(a)+b}->a^d\cdot c^b
c^{\log_c(a)-b}->\frac{a^d}{c^b}
c^{-\log_c(a)-b}->\frac{1}{a^dc^b}
c^{-\log_c(a)+b}->\frac{b^c}{a^d}
Infinity
{match:\log_c(\infty),replace:\infty,condition:c>1}
{match:\log_c(\infty),replace:-\infty,condition:0<c<1}