Incorrect inverse with swapped power and log
mlochbaum opened this issue · 2 comments
Example: expressions -:8 °(-:8) 3
and ÷:8 °(÷:8) 3
return 3 but ⁿ:8 °(ⁿ:8) 3
and ₙ:8 °(ₙ:8) 3
don't. It seems °(ⁿ:8) 3
is computed as °(ⁿ3) 8
and similarly for log, but the inverses should be ₙ8
for ⁿ:8
and ⁿ:8÷:1
for ₙ:8
.
(Found while checking if Uiua would do better than BQN on an inverse I had to back out, that is, Tr 440
with Tr ← ×⊙(ⁿ:2÷12)
. Not at the moment it seems.)
They should invert correctly now.
Not sure if this makes your case work though.
The math looks right. For Tr
it doesn't know how to work with dip and a constant. So it works if the arithmetic for Tr 440
is written out but not with Tr 440
itself. Code link if you want to take a look. What it would need to do is exchange ⊙(ⁿ:2÷12)
and 440
. I guess if it sees arithmetic followed by dip it could try this?