Given that we an initial bound on the problem [a, b], then the maximum error of using either a or b as our approximation is h = b − a. Because we halve the width of the interval with each iteration, the error is reduced by a factor of 2, and thus, the error after n iterations will be h/2n.
Therefore, thus, if εstep is fixed, then we may immediately know how many steps are required, after which we are assured that the absolute error is less than εstep. The inequality
may be solved for an integer value of n by finding:
For example, suppose that our initial interval is [0.7, 1.5]. If we have an εstep value of 1e-5, then we require a minimum of ⌈log2( 0.8/1e-5 )⌉ = 17 steps.
Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.