docs: @Override
  	public void setValueAndDerivative(RandomVariable value, RandomVariable derivative) {
  
  		double currentAccuracy;
  
  		switch (method) {
  		case AVERAGE:
  			currentAccuracy = value.abs().getAverage();
  			break;
  		case MAX:
  			currentAccuracy = value.abs().getMax();
  			break;
  		case MIN:
  			currentAccuracy = value.abs().getMin();
  			break;
  		default:
  			throw new IllegalArgumentException("Method to get current accuracy from RandomVariable not supported!");
  		}
  
  
  		if(currentAccuracy < accuracy)
  		{
  			accuracy	= currentAccuracy;
  			bestPoint	= nextPoint;
  		}
  
  		// Calculate next point
  		nextPoint = nextPoint.addRatio(value,derivative);
  
  		numberOfIterations++;
  
  	}