code: static double usingXArrAndYStride(
        final double[] xArr, final double yStride, final double x) {
      final int xArrLen = xArr.length;
      final int xArrLenM1 = xArrLen - 1;
  
      final int offset;
      assert ((xArrLen >= 4) && (x >= xArr[0]) && (x <= xArr[xArrLenM1]));
  
      if (x ==  xArr[xArrLenM1]) { /* corner case */
        return (yStride * (xArrLenM1));
      }
  
      offset = findStraddle(xArr, x); //uses recursion
      final int xArrLenM2 = xArrLen - 2;
      assert ((offset >= 0) && (offset <= (xArrLenM2)));
  
      if (offset == 0) { /* corner case */
        return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 0), x));
      }
      else if (offset == xArrLenM2) { /* corner case */
        return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 2), x));
      }
      /* main case */
      return (interpolateUsingXArrAndYStride(xArr, yStride, (offset - 1), x));
    }
docs: Used by HllEstimators