implemented linear error calculation (OptimizationCache)