ABSTRACT

Now that we can start to do simple arithmetic with unums and ubounds, we can track the number of bits used and compare that number with the bit cost of IEEE floats. The bit count for unums varies, so the prototype tallies global quantities ubitsmoved and numbersmoved that can be initialized to zero just before starting a routine we want to measure. The easiest way to compare the cost is usually the ratio of ubitsmoved to numbersmoved, because that immediately tells the average bits per number. That allows easy comparison with IEEE float precisions of 16, 32, 64, or 128 bits per number. Operations like addition read two numbers from memory and store one result, so addition increases numbersmoved by 3. The ubitsmoved counter adds the size in bits of each ubound for the two inputs and one output, measured with the nbits function.