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 16330)
+++ branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 16331)
@@ -166,90 +166,79 @@
     private Interval Evaluate(Instruction[] instructions, Dictionary<ISymbolicExpressionTreeNode, Interval> intervals = null) {
       Instruction currentInstr = instructions[InstructionCount++];
+      Interval intermediate = null;
+
       switch (currentInstr.opCode) {
         //Elementary arithmetic rules
         case OpCodes.Add: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Add(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Add(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         case OpCodes.Sub: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Subtract(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Subtract(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         case OpCodes.Mul: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Multiply(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Multiply(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         case OpCodes.Div: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Divide(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Divide(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         //Trigonometric functions
         case OpCodes.Sin: {
-            var s = Interval.Sine(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Sine(Evaluate(instructions, intervals));
+            break;
           }
         case OpCodes.Cos: {
-            var s = Interval.Cosine(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Cosine(Evaluate(instructions, intervals));
+            break;
           }
         case OpCodes.Tan: {
-            var s = Interval.Tangens(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Tangens(Evaluate(instructions, intervals));
+            break;
           }
         //Exponential functions
         case OpCodes.Log: {
-            var s = Interval.Logarithm(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Logarithm(Evaluate(instructions, intervals));
+            break;
           }
         case OpCodes.Exp: {
-            var s = Interval.Exponential(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Exponential(Evaluate(instructions, intervals));
+            break;
           }
         case OpCodes.Power: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Power(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Power(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         case OpCodes.Square: {
-            var s = Interval.Square(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.Square(Evaluate(instructions, intervals));
+            break;
           }
         case OpCodes.Root: {
-            var s = Evaluate(instructions, intervals);
-            for (int i = 1; i < currentInstr.nArguments; i++) {
-              s = Interval.Root(s, Evaluate(instructions, intervals));
-            }
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Evaluate(instructions, intervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              intermediate = Interval.Root(intermediate, Evaluate(instructions, intervals));
+            }
+            break;
           }
         case OpCodes.SquareRoot: {
-            var s = Interval.SquareRoot(Evaluate(instructions, intervals));
-            intervals.Add(currentInstr.dynamicNode, s);
-            return s;
+            intermediate = Interval.SquareRoot(Evaluate(instructions, intervals));
+            break;
           }
         //Variables, Constants, ...
@@ -267,4 +256,8 @@
           throw new NotSupportedException("Tree contains an unknown symbol.");
       }
+
+      if (intervals != null)
+        intervals.Add(currentInstr.dynamicNode, intermediate);
+      return intermediate;
     }
 
