Table-driven log2