Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Binary Search Error

  1. Aug 9, 2011 #1
    I have written a computer program that uses binary search to find the root to f(x) = 0, where f is an arbitrary (user-defined) function.

    If the rounding error [tex]\leq \epsilon[/tex] and the truncation error [tex]\leq \delta[/tex], what is the estimated accuracy of the output?

    Would the following reasoning be correct?
    Let [tex]r[/tex] be s.t. [tex]f(r) = 0[/tex]. Then [tex]f(x) = f(r) + (x-r)f'(r) + O((x-r)^2)[/tex]. So the estimated error is [tex]|x-r| \approx |\frac{f(x)}{f'(r)}| = \frac{\epsilon+\delta}{|f'(r)|}[/tex]?

    Thanks.

    Edited: I meant expanded till the divisor is NOT 0.
     
    Last edited: Aug 9, 2011
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: Binary Search Error
  1. Binary search help (Replies: 1)

  2. Binary Search Tree C++ (Replies: 1)

Loading...