title: Find zero points with recursion
body: <p>I want to find the zero points of a sine function. The parameter is a interval [a,b]. I have to it similar to binary search.</p>
  
  <p><em>Implement a function that searches for null points in the sinus function in a interval between a and b. The search-interval[lower limit, upper limit] should be halved until lower limit and upper limit are less then 0.0001 away from each other.</em></p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Aufg3 {
      public static void main(String[] args) {
  
          System.out.println(zeropoint(5,8));
      }
  
      private static double zeropoint(double a, double b){
          double middle = (a + b)/2;
  
          if(Math.sin(middle) &lt; 0){
              return zeropoint(a,middle);
          }else if(Math.sin(middle) &gt; 0){
              return zeropoint(middle,b);
          }else{
              return middle;
          }       
      }
  }
  </code></pre>
  
  <p>It gives me a lot of errors at the line with <em>return zeropoint(middle,b);</em></p>
  
  <p>In a first step I want to find just the first zero point in the interval.</p>
  
  <p>Any ideas?</p>