Calculating ? (cont.)
requires two multiplications and an addition for each.
? = log2(max(sqrt(r1), sqrt(r2)))
= 0.5 * log2 (max (r1,r2))
= log2 (max (r1,r2)) >> 1 (shift right by one)
log2 is not an easy calculation if you need an accurate fractional part (which we do).