Index: /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 17099)
+++ /stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 17100)
@@ -69,16 +69,16 @@
     #endregion
 
-    public Interval GetSymbolicExressionTreeInterval(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows = null) {
+    public Interval GetSymbolicExpressionTreeInterval(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows = null) {
       var variableRanges = DatasetUtil.GetVariableRanges(dataset, rows);
-      return GetSymbolicExressionTreeInterval(tree, variableRanges);
-    }
-
-    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree, IDataset dataset,
-      out Dictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals, IEnumerable<int> rows = null) {
+      return GetSymbolicExpressionTreeInterval(tree, variableRanges);
+    }
+
+    public Interval GetSymbolicExpressionTreeIntervals(ISymbolicExpressionTree tree, IDataset dataset,
+      out IDictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals, IEnumerable<int> rows = null) {
       var variableRanges = DatasetUtil.GetVariableRanges(dataset, rows);
-      return GetSymbolicExressionTreeIntervals(tree, variableRanges, out nodeIntervals);
-    }
-
-    public Interval GetSymbolicExressionTreeInterval(ISymbolicExpressionTree tree, Dictionary<string, Interval> variableRanges) {
+      return GetSymbolicExpressionTreeIntervals(tree, variableRanges, out nodeIntervals);
+    }
+
+    public Interval GetSymbolicExpressionTreeInterval(ISymbolicExpressionTree tree, IDictionary<string, Interval> variableRanges) {
       lock (syncRoot) {
         EvaluatedSolutions++;
@@ -88,10 +88,14 @@
       var outputInterval = Evaluate(instructions, ref instructionCount);
 
-      return outputInterval;
-    }
-
-
-    public Interval GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree,
-      Dictionary<string, Interval> variableRanges, out Dictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals) {
+      // because of numerical errors the bounds might be incorrect
+      if (outputInterval.LowerBound <= outputInterval.UpperBound)
+        return outputInterval;
+      else
+        return new Interval(outputInterval.UpperBound, outputInterval.LowerBound);
+    }
+
+
+    public Interval GetSymbolicExpressionTreeIntervals(ISymbolicExpressionTree tree,
+      IDictionary<string, Interval> variableRanges, out IDictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals) {
       lock (syncRoot) {
         EvaluatedSolutions++;
@@ -102,11 +106,23 @@
       var outputInterval = Evaluate(instructions, ref instructionCount, intervals);
 
-      nodeIntervals = intervals;
-
-      return outputInterval;
-    }
-
-
-    private static Instruction[] PrepareInterpreterState(ISymbolicExpressionTree tree, Dictionary<string, Interval> variableRanges) {
+      // fix incorrect intervals if necessary (could occur because of numerical errors)
+      nodeIntervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
+      foreach (var kvp in intervals) {
+        var interval = kvp.Value;
+        if (interval.IsInfiniteOrUndefined || interval.LowerBound <= interval.UpperBound)
+          nodeIntervals.Add(kvp.Key, interval);
+        else
+          nodeIntervals.Add(kvp.Key, new Interval(interval.UpperBound, interval.LowerBound));
+      }
+
+      // because of numerical errors the bounds might be incorrect
+      if (outputInterval.IsInfiniteOrUndefined || outputInterval.LowerBound <= outputInterval.UpperBound)
+        return outputInterval;
+      else
+        return new Interval(outputInterval.UpperBound, outputInterval.LowerBound);
+    }
+
+
+    private static Instruction[] PrepareInterpreterState(ISymbolicExpressionTree tree, IDictionary<string, Interval> variableRanges) {
       if (variableRanges == null)
         throw new ArgumentNullException("No variablew ranges are present!", nameof(variableRanges));
@@ -125,5 +141,5 @@
     }
 
-    private Interval Evaluate(Instruction[] instructions, ref int instructionCounter, Dictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals = null) {
+    private Interval Evaluate(Instruction[] instructions, ref int instructionCounter, IDictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals = null) {
       Instruction currentInstr = instructions[instructionCounter];
       //Use ref parameter, because the tree will be iterated through recursively from the left-side branch to the right side
@@ -200,4 +216,9 @@
             var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
             result = Interval.Tangens(argumentInterval);
+            break;
+          }
+        case OpCodes.Tanh: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.HyperbolicTangent(argumentInterval);
             break;
           }
Index: /stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
===================================================================
--- /stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 17099)
+++ /stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs	(revision 17100)
@@ -124,5 +124,5 @@
 
       double min = Math.Min(Math.Min(v1, v2), Math.Min(v3, v4));
-      double max = Math.Max(Math.Min(v1, v2), Math.Max(v3, v4));
+      double max = Math.Max(Math.Max(v1, v2), Math.Max(v3, v4));
       return new Interval(min, max);
     }
@@ -167,8 +167,11 @@
     }
     public static Interval Cosine(Interval a) {
-      return Interval.Sine(Interval.Subtract(a, new Interval(Math.PI / 2, Math.PI / 2)));
+      return Interval.Sine(Interval.Add(a, new Interval(Math.PI / 2, Math.PI / 2)));
     }
     public static Interval Tangens(Interval a) {
       return Interval.Divide(Interval.Sine(a), Interval.Cosine(a));
+    }  
+    public static Interval HyperbolicTangent(Interval a) {
+      return new Interval(Math.Tanh(a.LowerBound), Math.Tanh(a.UpperBound));
     }
 
@@ -201,9 +204,11 @@
 
     public static Interval Square(Interval a) {
-      return Power(a, new Interval(2, 2));
-    }
-
-    public static Interval Cubic(Interval a) {
-      return Power(a, new Interval(3, 3));
+      if (a.UpperBound <= 0) return new Interval(a.UpperBound * a.UpperBound, a.LowerBound * a.LowerBound);     // interval is negative
+      else if (a.LowerBound >= 0) return new Interval(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound); // interval is positive
+      else return new Interval(0, Math.Max(a.LowerBound*a.LowerBound, a.UpperBound*a.UpperBound)); // interval goes over zero
+    }
+
+    public static Interval Cube(Interval a) {
+      return new Interval(Math.Pow(a.LowerBound, 3), Math.Pow(a.UpperBound, 3));
     }
 
@@ -216,9 +221,11 @@
 
     public static Interval SquareRoot(Interval a) {
-      return Root(a, new Interval(2, 2));
+      if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN);
+      return new Interval(Math.Sqrt(a.LowerBound), Math.Sqrt(a.UpperBound));
     }
 
     public static Interval CubicRoot(Interval a) {
-      return Root(a, new Interval(3, 3));
+      if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN);
+      return new Interval(Math.Pow(a.LowerBound, 1.0/3), Math.Pow(a.UpperBound, 1.0/3));
     }
     #endregion
Index: /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs
===================================================================
--- /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17099)
+++ /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17100)
@@ -1,4 +1,3 @@
 ﻿using System;
-using HeuristicLab.Problems.DataAnalysis;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 
@@ -52,4 +51,7 @@
       //([-1, 1] * [0, 3]) * [-2, 2] = [-6, 6]
       Assert.AreEqual<Interval>(Interval.Multiply(Interval.Multiply(a, c), b), new Interval(-6, 6));
+
+      // [-2, 0] * [-2, 0]  = [0, 4]
+      Assert.AreEqual<Interval>(new Interval(0, 4), Interval.Multiply(new Interval(-2, 0), new Interval(-2, 0)));
     }
 
@@ -124,4 +126,39 @@
       Assert.AreEqual<Interval>(new Interval(1, Math.Exp(1)), Interval.Exponential(new Interval(0, 1)));
     }
+
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalSqrOperator() {
+      Assert.AreEqual<Interval>(new Interval(1, 4), Interval.Square(new Interval(1, 2)));
+      Assert.AreEqual<Interval>(new Interval(1, 4), Interval.Square(new Interval(-2, -1)));
+      Assert.AreEqual<Interval>(new Interval(0, 4), Interval.Square(new Interval(-2, 2)));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalSqrtOperator() {
+      Assert.AreEqual<Interval>(new Interval(1, 2), Interval.SquareRoot(new Interval(1, 4)));
+      Assert.AreEqual<Interval>(new Interval(double.NaN, double.NaN), Interval.SquareRoot(new Interval(-4, -1)));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalCubeOperator() {
+      Assert.AreEqual<Interval>(new Interval(1, 8), Interval.Cube(new Interval(1, 2)));
+      Assert.AreEqual<Interval>(new Interval(-8, -1), Interval.Cube(new Interval(-2, -1)));
+      Assert.AreEqual<Interval>(new Interval(-8, 8), Interval.Cube(new Interval(-2, 2)));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalCbrtOperator() {
+      Assert.AreEqual<Interval>(new Interval(1, 2), Interval.CubicRoot(new Interval(1, 8)));
+      Assert.AreEqual<Interval>(new Interval(double.NaN, double.NaN), Interval.CubicRoot(new Interval(-8, -1)));
+    }
   }
 }
Index: /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs
===================================================================
--- /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs	(revision 17099)
+++ /stable/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs	(revision 17100)
@@ -34,5 +34,5 @@
     }
 
-    private void EvaluateTest(string expression, Interval expectedResult, Dictionary<string, Interval> variableRanges = null) {
+    private void EvaluateTest(string expression, Interval expectedResult, Dictionary<string, Interval> variableRanges = null, double lowerDelta =0, double upperDelta = 0) {
       var parser = new InfixExpressionParser();
       var tree = parser.Parse(expression);
@@ -40,9 +40,10 @@
       Interval result;
       if (variableRanges == null)
-        result = interpreter.GetSymbolicExressionTreeInterval(tree, problemData.Dataset, problemData.AllIndices);
+        result = interpreter.GetSymbolicExpressionTreeInterval(tree, problemData.Dataset, problemData.AllIndices);
       else
-        result = interpreter.GetSymbolicExressionTreeInterval(tree, variableRanges);
+        result = interpreter.GetSymbolicExpressionTreeInterval(tree, variableRanges);
 
-      Assert.AreEqual(expectedResult, result);
+      Assert.AreEqual(expectedResult.LowerBound, result.LowerBound, lowerDelta);
+      Assert.AreEqual(expectedResult.UpperBound, result.UpperBound, upperDelta);
     }
 
@@ -79,4 +80,17 @@
       EvaluateTest("sin(x1+x2)", new Interval(-1, 1), variableRanges);
       EvaluateTest("sin(1+2)", new Interval(Math.Sin(3), Math.Sin(3)));
+
+      var localVarRanges = new Dictionary<string, Interval>();
+      localVarRanges.Add("x1", new Interval(-1, 1));
+      localVarRanges.Add("x2", new Interval(-(Math.PI / 2), 0));
+      localVarRanges.Add("x3", new Interval(0, Math.PI / 2));
+      localVarRanges.Add("x4", new Interval(-Math.PI, Math.PI));
+      localVarRanges.Add("x5", new Interval(Math.PI/4, Math.PI*3.0/4));
+
+      EvaluateTest("sin(x1)", new Interval(Math.Sin(-1), Math.Sin(1)), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("sin(x2)", new Interval(-1, 0), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("sin(x3)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("sin(x4)", new Interval(-1, 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("sin(x5)", new Interval(Math.Sin(Math.PI/4), 1), localVarRanges, 1E-8, 1E-8);
     }
 
@@ -87,6 +101,57 @@
       EvaluateTest("cos(x1+x2)", new Interval(-1, 1));
       EvaluateTest("cos(x1+x2)", new Interval(-1, 1), variableRanges);
-      EvaluateTest("cos(1+2)", new Interval(Math.Sin(3 - Math.PI / 2), Math.Sin(3 - Math.PI / 2)));
+      EvaluateTest("cos(1+2)", new Interval(Math.Sin(3 + Math.PI / 2), Math.Sin(3 + Math.PI / 2)));
+
+      var localVarRanges = new Dictionary<string, Interval>();
+      localVarRanges.Add("x1", new Interval(-1, 1));
+      localVarRanges.Add("x2", new Interval(-(Math.PI / 2), 0));
+      localVarRanges.Add("x3", new Interval(0, Math.PI / 2));
+      localVarRanges.Add("x4", new Interval(-Math.PI, Math.PI));
+      localVarRanges.Add("x5", new Interval(Math.PI / 4, Math.PI * 3.0 / 4));
+
+      EvaluateTest("cos(x1)", new Interval(Math.Cos(-1), 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("cos(x2)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("cos(x3)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("cos(x4)", new Interval(-1, 1), localVarRanges, 1E-8, 1E-8);
+      EvaluateTest("cos(x5)", new Interval(Math.Cos(Math.PI *3.0/ 4), Math.Cos(Math.PI/ 4)), localVarRanges, 1E-8, 1E-8);
+
     }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterTan() {
+      // critical values:
+      // lim tan(x) = -inf for x => -pi/2
+      // lim tan(x) = +inf for x =>  pi/2
+      var variableRanges = new Dictionary<string, Interval>();
+      variableRanges.Add("x1", new Interval(-1, 1));
+      variableRanges.Add("x2", new Interval(-(Math.PI / 2), 0));
+      variableRanges.Add("x3", new Interval(0, Math.PI / 2));
+      variableRanges.Add("x4", new Interval(-Math.PI, Math.PI));
+
+      EvaluateTest("tan(x1)", new Interval(Math.Tan(-1), Math.Tan(1)), variableRanges, 1E-8, 1E-8);
+      EvaluateTest("tan(x2)", new Interval(double.NegativeInfinity, 0), variableRanges, 0, 1E-8);
+      EvaluateTest("tan(x3)", new Interval(0, 8.16588936419192E+15), variableRanges, 0, 1E6); // actually upper bound should be infinity.
+      EvaluateTest("tan(x4)", new Interval(double.NegativeInfinity, double.PositiveInfinity), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterTanh() {
+      // critical values:
+      // lim tanh(x) = -1 for x => -inf
+      // lim tanh(x) =  1 for x =>  inf
+      var variableRanges = new Dictionary<string, Interval>();
+      variableRanges.Add("x1", new Interval(-1, 1));
+      variableRanges.Add("x2", new Interval(double.NegativeInfinity, 0));
+      variableRanges.Add("x3", new Interval(0, double.PositiveInfinity));
+
+      EvaluateTest("tanh(x1)", new Interval(Math.Tanh(-1), Math.Tanh(1)), variableRanges);
+      EvaluateTest("tanh(x2)", new Interval(-1, 0), variableRanges);
+      EvaluateTest("tanh(x3)", new Interval(0, 1), variableRanges);
+    }
+
 
     [TestMethod]
