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