Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17510)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17511)
@@ -61,8 +61,9 @@
       var variableRanges = problemData.VariableRanges.GetIntervals();
 
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) {
+        return 0;
+      }
+
       var r2 = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData, problemData.TrainingIndices, applyLinearScaling, 10);
-      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) {
-        r2 = 0;
-      }
       return r2;
     }
@@ -85,28 +86,4 @@
       return r2;
     }
-
-    private static bool HasConstraintVioluations(IEnumerable<IntervalConstraint> constraints, IntervalInterpreter intervalInterpreter,
-      IDictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution) {
-      foreach (var constraint in constraints) {
-        if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
-          throw new ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.", nameof(IntervalConstraintsParser));
-        if (!constraint.IsDerivative) {
-          var res = intervalInterpreter.GetSymbolicExpressionTreeInterval(solution, variableRanges);
-          if (!constraint.Interval.Contains(res)) {
-            return true;
-          }
-        } else {
-          var tree = solution;
-          for (var i = 0; i < constraint.NumberOfDerivations; ++i) {
-            tree = DerivativeCalculator.Derive(tree, constraint.Variable);
-          }
-          var res = intervalInterpreter.GetSymbolicExpressionTreeInterval(tree, variableRanges);
-          if (!constraint.Interval.Contains(res)) {
-            return true;
-          }
-        }
-      }
-      return false;
-    }
   }
 }
Index: branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs
===================================================================
--- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17510)
+++ branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17511)
@@ -62,24 +62,12 @@
       var tree = solution;
 
-      double r;
-      if (applyLinearScaling) {
-        var rCalculator = new OnlinePearsonsRCalculator();
-        CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, rCalculator, problemData.Dataset.Rows);
-        var model = new SymbolicRegressionModel(problemData.TargetVariable, solution, interpreter, lowerEstimationLimit, upperEstimationLimit);
-        model.Scale(problemData);
-        tree = model.SymbolicExpressionTree;
-        errorState = rCalculator.ErrorState;
-        r = rCalculator.R;
-      } else {
-        IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
-        r = OnlinePearsonsRCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);
-      }
-
       if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) {
         return 0;
       }
 
-      if (errorState != OnlineCalculatorError.None) return double.NaN;
-      return r * r;
+      var r2 = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, solution, lowerEstimationLimit,
+        upperEstimationLimit, problemData, rows, applyLinearScaling);
+
+      return r2;
     }
 
