I checked the paper. I think the correct mapping should be

~~~
val p = math.ceil(2.0 * math.log(1.054 / relativeSD) / math.log(2)).toInt
~~~

`HyperLogLogPlus` uses 64-bit hash. The constant `beta` is `1.054` in the paper. To guarantee the precision, we need `ceil`. We also need to check whether `p` is out of bound if `relativeSD` is really small.