private static int recursiveFindStraddle(final double[] xArr, final int left, final int right,
      final double x) {
    final int middle;
    assert (left < right);
    assert ((xArr[left] <= x) && (x < xArr[right])); /* the invariant */
    if ((left + 1) == right) {
      return (left);
    }
    middle = left + ((right - left) / 2);
    if (xArr[middle] <= x) {
      return (recursiveFindStraddle(xArr, middle, right, x));
    } else {
      return (recursiveFindStraddle(xArr, left, middle, x));
    }
  }
private static int recursiveFindStraddle ( final double [ ] xArr , final int left , final int right , final double x ) { final int middle ; assert ( left < right ) ; assert ( ( xArr [ left ] <= x ) && ( x < xArr [ right ] ) ) ; if ( ( left + 1 ) == right ) { return ( left ) ; } middle = left + ( ( right - left ) / 2 ) ; if ( xArr [ middle ] <= x ) { return ( recursiveFindStraddle ( xArr , middle , right , x ) ) ; } else { return ( recursiveFindStraddle ( xArr , left , middle , x ) ) ; } }
In C: again-two-registers.c find_straddle_aux L1322