/src/main/java/net/finmath/interpolation/BiLinearInterpolation.java
int upperIndexY = Math.min( Math.max( indexGreaterOrEqualY, lowerIndexX) , this.y.length-1) ;
int upperIndexY = Math.min ( Math.max ( indexGreaterOrEqualY, 0 ) , this.y.length-1 ) ;
int upperIndexX = Math.min(Math.max(indexGreaterOrEqualX, 0), this.x.length-1); final int lowerIndexX = Math.min(Math.max(upperIndexX-1, 0), this.x.length-1); int indexGreaterOrEqualY = Arrays.binarySearch(this.y, y); if(indexGreaterOrEqualY < 0) { indexGreaterOrEqualY = -indexGreaterOrEqualY-1; } <extra_id_0> final int lowerIndexY = Math.min(Math.max(upperIndexY-1, 0), this.y.length-1); if(upperIndexX == lowerIndexX) { upperIndexX++; } if(upperIndexY == lowerIndexY) { upperIndexY++;