Index: branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs
===================================================================
--- branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 16363)
+++ branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 16364)
@@ -78,30 +78,7 @@
         ResetInstrucitonCount();
       }
-      var instructions = PrepareInterpreterState(tree, rows, dataset);
+      var intervalBoundaries = DatasetUtil.GetVariableBoundaries(dataset, rows);
+      var instructions = PrepareInterpreterState(tree, intervalBoundaries);
       var x = Evaluate(instructions);
-
-      return x;
-    }
-
-    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, Dictionary<string, Interval> customIntervals, IEnumerable<int> rows = null) {
-      lock (syncRoot) {
-        EvaluatedSolutions++;
-        ResetInstrucitonCount();
-      }
-      var instructions = PrepareInterpreterState(tree, rows, null, customIntervals);
-      var x = Evaluate(instructions);
-
-      return x;
-    }
-
-    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, IDataset dataset,
-      Dictionary<string, Interval> customIntervals, out Dictionary<ISymbolicExpressionTreeNode, Interval> intervals, IEnumerable<int> rows = null) {
-      lock (syncRoot) {
-        EvaluatedSolutions++;
-        ResetInstrucitonCount();
-      }
-      intervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
-      var instructions = PrepareInterpreterState(tree, rows, dataset, customIntervals);
-      var x = Evaluate(instructions, intervals);
 
       return x;
@@ -110,10 +87,11 @@
     public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, IDataset dataset,
       out Dictionary<ISymbolicExpressionTreeNode, Interval> intervals, IEnumerable<int> rows = null) {
-      lock(syncRoot) {
-        EvaluatedSolutions++;
-        ResetInstrucitonCount();
-      }
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+        ResetInstrucitonCount();
+      }
+      var intervalBoundaries = DatasetUtil.GetVariableBoundaries(dataset, rows);
       intervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
-      var instructions = PrepareInterpreterState(tree, rows, dataset);
+      var instructions = PrepareInterpreterState(tree, intervalBoundaries);
       var x = Evaluate(instructions, intervals);
 
@@ -121,6 +99,18 @@
     }
 
-    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, Dictionary<string, Interval> customIntervals, 
-      out Dictionary<ISymbolicExpressionTreeNode, Interval> intervals, IEnumerable<int> rows = null) {
+    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, Dictionary<string, Interval> customIntervals) {
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+        ResetInstrucitonCount();
+      }
+      var instructions = PrepareInterpreterState(tree, customIntervals);
+      var x = Evaluate(instructions);
+
+      return x;
+    }
+
+
+    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree,
+      Dictionary<string, Interval> customIntervals, out Dictionary<ISymbolicExpressionTreeNode, Interval> intervals) {
       lock (syncRoot) {
         EvaluatedSolutions++;
@@ -128,5 +118,5 @@
       }
       intervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
-      var instructions = PrepareInterpreterState(tree, rows, null, customIntervals);
+      var instructions = PrepareInterpreterState(tree, customIntervals);
       var x = Evaluate(instructions, intervals);
 
@@ -134,35 +124,24 @@
     }
 
-    private static Instruction[] PrepareInterpreterState(ISymbolicExpressionTree tree,
-      IEnumerable<int> rows = null, IDataset dataset = null, Dictionary<string, Interval> customIntervals = null) {
+
+    private static Instruction[] PrepareInterpreterState(ISymbolicExpressionTree tree, Dictionary<string, Interval> customIntervals) {
       Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
 
-      if (dataset == null && customIntervals == null)
-        throw new Exception("No dataset or ranges for intervals are given!");
-
-      if(rows == null)
-        rows = Enumerable.Range(0, dataset.Rows);
-
-      foreach (Instruction instr in code) {
-        if (instr.opCode == OpCodes.Variable) {
-          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
-          IList<double> values = new List<double>();
-
-          if (customIntervals != null) {
-            if (customIntervals.ContainsKey(variableTreeNode.VariableName)) {
-              instr.data = customIntervals[variableTreeNode.VariableName];
-            }
-          } else {
-            foreach (var rowEnum in rows) {
-              values.Add(dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName)[rowEnum]);
-            }
-            instr.data = new Interval(values.Min(), values.Max());
-          }
-        }
+      if (customIntervals == null)
+        throw new ArgumentException("No interval ranges are present!", nameof(customIntervals));
+
+      foreach (var variable in tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(n => n.VariableName).Distinct()) {
+        if (!customIntervals.ContainsKey(variable)) throw new InvalidOperationException($"No ranges for variable {variable} is present");
+      }
+
+      foreach (Instruction instr in code.Where(i => i.opCode == OpCodes.Variable)) {
+        var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+        instr.data = customIntervals[variableTreeNode.VariableName];
       }
       return code;
     }
 
-    private Interval Evaluate(Instruction[] instructions, Dictionary<ISymbolicExpressionTreeNode, Interval> intervals = null) {
+    private Interval Evaluate(Instruction[] instructions, Dictionary<ISymbolicExpressionTreeNode,
+      Interval> intervals = null) {
       Instruction currentInstr = instructions[InstructionCount++];
       Interval intermediate = null;
Index: branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs
===================================================================
--- branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs	(revision 16363)
+++ branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs	(revision 16364)
@@ -93,5 +93,5 @@
     }
 
-    public static Dictionary<string, Interval> GetVariableBoundaries(IDataset dataset) {
+    public static Dictionary<string, Interval> GetVariableBoundaries(IDataset dataset, IEnumerable<int> rows = null) {
       Dictionary<string, Interval> variableBoundaries = new Dictionary<string, Interval>();
 
@@ -100,7 +100,15 @@
         var max = double.MinValue;
 
-        foreach (var val in dataset.GetDoubleValues(variable)) {
-          if (val < min) min = val;
-          if (val > max) max = val;
+        if (rows != null) {
+          foreach (int row in rows) {
+            var val = dataset.GetDoubleValue(variable, row);
+            if (val < min) min = val;
+            if (val > max) max = val;
+          }
+        } else {
+          foreach (var val in dataset.GetDoubleValues(variable)) {
+            if (val < min) min = val;
+            if (val > max) max = val;
+          }
         }
         variableBoundaries.Add(variable, new Interval(min, max));
