11.001001000011111101101010100010001000 Arithmazium
Home

Are there smaller values than powers of the radix?

The next test is more subtle. It asks whether the difference between two tiny values can be a number smaller than values reached by just scaling by powers of the radix.

[QUESTION: Is “Products underflow at a higher threshold…” really a correct report? What’s being compared are two different beasts: one is a simple scaled-down value while the other is the nonzero difference between two such values. It is interesting that we can obtain a smaller value from a difference than from a product, but to talk about the underflow threshold, we should talk about the values producing the difference.]

# Compared here are min_positive, the smallest nonzero value
# gotten by successively multiplying by H, and add_sub_tiny,
# which is |x - (x*H)/H| for a tiny x.
if (add_sub_tiny != ZERO) and (add_sub_tiny != min_positive):
    bad_cond(err_defect, "")
    if (add_sub_tiny < min_positive):
        print("Products underflow at a higher", end="")
        print(" threshold than differences.")
        if too_tiny_x == ZERO:  # Only if there are NO pseudo-zeros.
            # Don't admit add_sub_tiny if it could be a pseudo-zero.
            min_positive = add_sub_tiny
    else:
        print("Difference underflows at a higher", end="")
        print(" threshold than products.")
print("Smallest strictly positive number found is min_positive = {:g} ."
      .format(min_positive))
Home