codegen optimisation for log2 and log10