/src/main/java/net/finmath/optimizer/StochasticPathwiseLevenbergMarquardt.java
derivative[valueIndex] = derivative[valueIndex].isNaN( ).sub( 4.5).mult( -1).choose( derivative[valueIndex], new Scalar( 0.0) ) ;
derivative[valueIndex] = derivative[valueIndex].isNaN ( ) .sub ( 0.5 ) .mult ( -1 ) .choose ( derivative[valueIndex], new Scalar ( 0.0 ) ) ;
prepareAndSetValues(parametersNew, derivative); } catch (final Exception e) { Arrays.fill(derivative, new RandomVariableFromDoubleArray(Double.NaN)); } for (int valueIndex = 0; valueIndex < valueCurrent.length; valueIndex++) { derivative[valueIndex] = derivative[valueIndex].sub(valueCurrent[valueIndex]).div(parameterFiniteDifference); <extra_id_0> } return derivative; } }; if(executor != null) { final Future<RandomVariable[]> valueFuture = executor.submit(worker);