import math


def optimum_qubit_size(precision: int, error: float) -> int:
    """
    Return the number of qubit required for targeted number of decimal
    and error rate.
    """
    return math.ceil(precision + math.log2(2+1/(2*error)))