Open rowanG077 opened 2 years ago
While working on it I'm not actually sure this is legal for naturals in the way the solvers function.
For example Log 10 (50 * 2)
prior to this PR will reduce to Log 10 100 -> 2
. But depending on the way the plugins fire after this PR it might reduce like this: Log 10 (50 * 2) -> Log 10 50 + Log 10 2
and now it will report this as unsolvable as both the logs will not cleanly reduce to a Natural.
I feel like similar issues exist for the other rule but I don't have an example handy.
I guess doing the rewrites the other way should be fine.
Ready for review
I choose not to normalise x * log b a
to log b a^x
because I feel like dealing with exponents sucks. And the rewrite the other way around is unsound.
note that I used the withSOPNormalize
from this closed PR: https://github.com/clash-lang/ghc-typelits-extra/pull/36
because I feel like dealing with exponents sucks
I can already see @christiaanb reading this and going "yep" :eyes:
Normalise
Log base (a * b * ... * z)
toLog base a + Log base b + ... + Log base z
NormaliseLog b (x^y)
toy * Log b x