ternary logarithms