change log(2) to constants::ln_two<T>()