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