My log_base function allows you to compute logs to any positive base. If you have to
perform a lot of logs to the same base, it is more efficient to rewrite the code to cache
the log(base) once. Here is an example of using log_base :