Added logarithms with arbitrary base. Used by the solver.