11.001001000011111101101010100010001000 Arithmazium
Home

Refining ulps of 1±

Before finalizing our computation of the radix and precision, we refine the units in the last place of numbers just bigger and smaller than \(1\). In the previous sections, we computed first guesses. Now, the specialized functions find_ulp_of_one_plus() and find_ulp_of_one_minus() nail the values down.

print("Recalculating radix and precision")
ULP_OF_ONE_PLUS = find_ulp_of_one_plus(guess_ulp_of_one_plus)
ULP_OF_ONE_MINUS = find_ulp_of_one_minus(guess_ulp_of_one_minus)
if (ULP_OF_ONE_MINUS == guess_ulp_of_one_minus):
    print("confirms closest relative separation ULP_OF_ONE_MINUS ")
else:
    print("gets better closest relative separation ULP_OF_ONE_MINUS = "
          + "{:0.7e} .".format(ULP_OF_ONE_MINUS))
Home