Index: branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs
===================================================================
--- branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs	(revision 17211)
+++ branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/Interpreter.cs	(revision 17212)
@@ -484,4 +484,8 @@
     [DebuggerBrowsable(DebuggerBrowsableState.Never)]
     public AlgebraicDouble One => new AlgebraicDouble(1.0);
+
+    public bool IsInfinity => IsNegativeInfinity || IsPositiveInfinity;
+    public bool IsNegativeInfinity => double.IsNegativeInfinity(Value);
+    public bool IsPositiveInfinity => double.IsPositiveInfinity(Value);
     public AlgebraicDouble() { }
     public AlgebraicDouble(double value) { this.Value = value; }
@@ -497,5 +501,5 @@
     public AlgebraicDouble AssignCos(AlgebraicDouble a) { Value = Math.Cos(a.Value); return this; }
     public AlgebraicDouble AssignTanh(AlgebraicDouble a) { Value = Math.Tanh(a.Value); return this; }
-    public AlgebraicDouble AssignLog(AlgebraicDouble a) { Value = a.Value <= 0 ? double.NegativeInfinity : Math.Log(a.Value); return this; } // alternative definiton of log to prevent NaN
+    public AlgebraicDouble AssignLog(AlgebraicDouble a) { Value = Math.Log(a.Value); return this; } 
     public AlgebraicDouble AssignExp(AlgebraicDouble a) { Value = Math.Exp(a.Value); return this; }
     public AlgebraicDouble AssignIntPower(AlgebraicDouble a, int p) { Value = Math.Pow(a.Value, p); return this; }
@@ -803,7 +807,19 @@
       var v4 = high.Clone().Mul(a.high);
 
-      low = Algebraic.Min(Algebraic.Min(v1, v2), Algebraic.Min(v3, v4));
-      high = Algebraic.Max(Algebraic.Max(v1, v2), Algebraic.Max(v3, v4));
-      return this;
+      low = Min(Min(v1, v2), Min(v3, v4));
+      high = Max(Max(v1, v2), Max(v3, v4));
+
+      return this;
+    }
+
+    // algebraic min() / max() do not work for infinities 
+    // detect and handle infinite values explicitly
+    private static MultivariateDual<AlgebraicDouble> Min(MultivariateDual<AlgebraicDouble> a, MultivariateDual<AlgebraicDouble> b) {
+      if (a.Value.IsInfinity || b.Value.IsInfinity) return a.Value < b.Value ? a : b; // NOTE: this is not differentiable but for infinite values we do not care
+      else return Algebraic.Min(a, b); // differentiable statement
+    }
+    private static MultivariateDual<AlgebraicDouble> Max(MultivariateDual<AlgebraicDouble> a, MultivariateDual<AlgebraicDouble> b) {
+      if (a.Value.IsInfinity || b.Value.IsInfinity) return a.Value >= b.Value ? a : b; // NOTE: this is not differentiable but for infinite values we do not care
+      else return Algebraic.Max(a, b); // differentiable statement
     }
 
@@ -815,5 +831,5 @@
 
     public AlgebraicInterval AssignCos(AlgebraicInterval a) {
-      return AssignSin(a.Clone().Sub(new AlgebraicInterval(Math.PI / 2, Math.PI / 2)));
+      return AssignSin(a.Clone().Add(new AlgebraicInterval(Math.PI / 2, Math.PI / 2)));
     }
 
@@ -821,10 +837,23 @@
       if (a.Contains(0.0)) {
         if (a.low.Value.Value == 0 && a.high.Value.Value == 0) {
+          if (this.low.Value >= 0) {
+            // pos / 0
+          } else if (this.high.Value <= 0) {
+            // neg / 0
+          } else {
+            low = new MultivariateDual<AlgebraicDouble>(double.NegativeInfinity);
+            high = new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity);
+          }
+        } else if (a.low.Value.Value >= 0) {
+          // a is positive 
+          Mul(new AlgebraicInterval(a.Clone().high.Inv(), new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity)));
+        } else if (a.high.Value <= 0) {
+          // a is negative
+          Mul(new AlgebraicInterval(new MultivariateDual<AlgebraicDouble>(double.NegativeInfinity), a.low.Clone().Inv()));
+        } else {
+          // a is interval over zero
           low = new MultivariateDual<AlgebraicDouble>(double.NegativeInfinity);
           high = new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity);
-        } else if (a.low.Value.Value == 0)
-          Mul(new AlgebraicInterval(a.Clone().high.Inv(), new MultivariateDual<AlgebraicDouble>(double.PositiveInfinity)));
-        else
-          Mul(new AlgebraicInterval(new MultivariateDual<AlgebraicDouble>(double.NegativeInfinity), a.low.Clone().Inv()));
+        }
       } else {
         Mul(new AlgebraicInterval(a.high.Clone().Inv(), a.low.Clone().Inv())); // inverting leads to inverse roles of high and low
@@ -947,4 +976,5 @@
         low = new MultivariateDual<AlgebraicDouble>(-1.0); // zero gradient
         high = new MultivariateDual<AlgebraicDouble>(1.0);
+        return this;
       }
 
@@ -1145,4 +1175,5 @@
     public MultivariateDual<V> AssignAbs(MultivariateDual<V> a) { v.AssignAbs(a.v); dv.Assign(a.dv).Scale(a.v.Clone().Sgn()); return this; }      // abs(f(x))' = f(x)*f'(x) / |f(x)|  doesn't work for intervals      
     public MultivariateDual<V> AssignSgn(MultivariateDual<V> a) { v.AssignSgn(a.v); dv = a.dv.Zero; return this; } // sign(f(x))' = 0;     
+
   }
 }
Index: branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/AutoDiffIntervalTest.cs
===================================================================
--- branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/AutoDiffIntervalTest.cs	(revision 17211)
+++ branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/AutoDiffIntervalTest.cs	(revision 17212)
@@ -11,5 +11,5 @@
     private readonly AlgebraicInterval d = new AlgebraicInterval(1, 3);
     private readonly AlgebraicInterval e = new AlgebraicInterval(4, 6);
-    private readonly IntervalEvaluator eval = new  IntervalEvaluator();
+    private readonly IntervalEvaluator eval = new IntervalEvaluator();
 
     [TestMethod]
@@ -20,9 +20,23 @@
 
       // [-1,1] + [-2,2] = [-3,3]
-      Assert.AreEqual(Add(a, b), new AlgebraicInterval(-3, 3));
+      AssertAreEqualInterval(Add(a, b), new AlgebraicInterval(-3, 3));
       //([-1, 1] + [-2, 2]) + [0, 3] = [-3, 6]
-      Assert.AreEqual(Add(Add(a, b), c), new AlgebraicInterval(-3, 6));
+      AssertAreEqualInterval(Add(Add(a, b), c), new AlgebraicInterval(-3, 6));
       //([-1, 1] + [0, 3]) + [-2, 2] = [-3, 6]
-      Assert.AreEqual(Add(Add(a, c), b), new AlgebraicInterval(-3, 6));
+      AssertAreEqualInterval(Add(Add(a, c), b), new AlgebraicInterval(-3, 6));
+    }
+
+    private void AssertAreEqualInterval(AlgebraicInterval a, AlgebraicInterval b) {
+      if (double.IsNaN(a.LowerBound.Value)) {
+        Assert.IsTrue(double.IsNaN(b.LowerBound.Value));
+      } else {
+        Assert.AreEqual(a.LowerBound.Value.Value, b.LowerBound.Value.Value, 1e-10);
+      }
+
+      if (double.IsNaN(a.UpperBound.Value)) {
+        Assert.IsTrue(double.IsNaN(b.UpperBound.Value));
+      } else {
+        Assert.AreEqual(a.UpperBound.Value.Value, b.UpperBound.Value.Value, 1e-10);
+      }
     }
 
@@ -38,9 +52,9 @@
 
       //[-1, 1] - [-2, 2] = [-3, 3]
-      Assert.AreEqual(Subtract(a, b), new AlgebraicInterval(-3, 3));
+      AssertAreEqualInterval(Subtract(a, b), new AlgebraicInterval(-3, 3));
       //([-1, 1] - [-2, 2]) - [0, 3] = [-6, 3]
-      Assert.AreEqual(Subtract(Subtract(a, b), c), new AlgebraicInterval(-6, 3));
+      AssertAreEqualInterval(Subtract(Subtract(a, b), c), new AlgebraicInterval(-6, 3));
       //([-1, 1] - [0, 3]) - [-2, 2] = [-6, 3]
-      Assert.AreEqual(Subtract(Subtract(a, c), b), new AlgebraicInterval(-6, 3));
+      AssertAreEqualInterval(Subtract(Subtract(a, c), b), new AlgebraicInterval(-6, 3));
     }
 
@@ -56,12 +70,12 @@
 
       //[-1, 1] * [-2, 2] = [-2, 2]
-      Assert.AreEqual(Multiply(a, b), new AlgebraicInterval(-2, 2));
+      AssertAreEqualInterval(Multiply(a, b), new AlgebraicInterval(-2, 2));
       //([-1, 1] * [-2, 2]) * [0, 3] = [-6, 6]
-      Assert.AreEqual(Multiply(Multiply(a, b), c), new AlgebraicInterval(-6, 6));
+      AssertAreEqualInterval(Multiply(Multiply(a, b), c), new AlgebraicInterval(-6, 6));
       //([-1, 1] * [0, 3]) * [-2, 2] = [-6, 6]
-      Assert.AreEqual(Multiply(Multiply(a, c), b), new AlgebraicInterval(-6, 6));
+      AssertAreEqualInterval(Multiply(Multiply(a, c), b), new AlgebraicInterval(-6, 6));
 
       // [-2, 0] * [-2, 0]  = [0, 4]
-      Assert.AreEqual(new AlgebraicInterval(0, 4), Multiply(new AlgebraicInterval(-2, 0), new AlgebraicInterval(-2, 0)));
+      AssertAreEqualInterval(new AlgebraicInterval(0, 4), Multiply(new AlgebraicInterval(-2, 0), new AlgebraicInterval(-2, 0)));
     }
 
@@ -77,16 +91,14 @@
 
       //[4, 6] / [1, 3] = [4/3, 6]
-      Assert.AreEqual(Divide(e, d), new AlgebraicInterval(4.0 / 3.0, 6));
+      AssertAreEqualInterval(Divide(e, d), new AlgebraicInterval(4.0 / 3.0, 6));
       //([4, 6] / [1, 3]) / [1, 3] = [4/9, 6]
-      Assert.AreEqual(Divide(Divide(e, d), d), new AlgebraicInterval(4.0 / 9.0, 6));
+      AssertAreEqualInterval(Divide(Divide(e, d), d), new AlgebraicInterval(4.0 / 9.0, 6));
       //[4, 6] / [0, 3] = [4/3, +Inf]
-      Assert.AreEqual(Divide(e, c), new AlgebraicInterval(4.0 / 3.0, double.PositiveInfinity));
+      AssertAreEqualInterval(Divide(e, c), new AlgebraicInterval(4.0 / 3.0, double.PositiveInfinity));
       //[-1, 1] / [0, 3] = [+Inf, -Inf]
-      Assert.AreEqual(Divide(a, c), new AlgebraicInterval(double.NegativeInfinity, double.PositiveInfinity));
-      //Devision by 0 ==> IsInfiniteOrUndefined == true
-      
-      //Devision by 0 ==> IsInfiniteOrUndefined == true
-      
-      Assert.AreEqual(Divide(d, b), new AlgebraicInterval(double.NegativeInfinity, double.PositiveInfinity));
+      AssertAreEqualInterval(Divide(a, c), new AlgebraicInterval(double.NegativeInfinity, double.PositiveInfinity));
+
+      //Division by 0 ==> IsInfiniteOrUndefined == true
+      AssertAreEqualInterval(Divide(d, b), new AlgebraicInterval(double.NegativeInfinity, double.PositiveInfinity));
     }
 
@@ -101,14 +113,14 @@
       //sine depends on interval
       //sin([0, 2*pi]) = [-1, 1]
-      Assert.AreEqual(Sine(new AlgebraicInterval(0, 2 * Math.PI)), new AlgebraicInterval(-1, 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(0, 2 * Math.PI)), new AlgebraicInterval(-1, 1));
       //sin([-pi/2, pi/2]) = [sin(-pi/2), sin(pi/2)]
-      Assert.AreEqual(Sine(new AlgebraicInterval(-1 * Math.PI / 2, Math.PI / 2)), new AlgebraicInterval(-1, 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(-1 * Math.PI / 2, Math.PI / 2)), new AlgebraicInterval(-1, 1));
       //sin([0, pi/2]) = [sin(0), sin(pi/2)]
-      Assert.AreEqual(Sine(new AlgebraicInterval(0, Math.PI / 2)), new AlgebraicInterval(0, 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(0, Math.PI / 2)), new AlgebraicInterval(0, 1));
       //sin([pi, 3*pi/2]) = [sin(pi), sin(3*pi/2)]
-      Assert.AreEqual(Sine(new AlgebraicInterval(Math.PI, 3 * Math.PI / 2)), new AlgebraicInterval(-1, 0));
-      Assert.AreEqual(Sine(new AlgebraicInterval(1, 2)), new AlgebraicInterval(Math.Min(Math.Sin(1), Math.Sin(2)), 1));
-      Assert.AreEqual(Sine(new AlgebraicInterval(1, 3)), new AlgebraicInterval(Math.Min(Math.Sin(1), Math.Sin(3)), 1));
-      Assert.AreEqual(Sine(new AlgebraicInterval(Math.PI, 5 * Math.PI / 2)), new AlgebraicInterval(-1, 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(Math.PI, 3 * Math.PI / 2)), new AlgebraicInterval(-1, 0));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(1, 2)), new AlgebraicInterval(Math.Min(Math.Sin(1), Math.Sin(2)), 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(1, 3)), new AlgebraicInterval(Math.Min(Math.Sin(1), Math.Sin(3)), 1));
+      AssertAreEqualInterval(Sine(new AlgebraicInterval(Math.PI, 5 * Math.PI / 2)), new AlgebraicInterval(-1, 1));
     }
 
@@ -122,6 +134,6 @@
     public void TestIntervalCosineOperator() {
       //Cosine uses sine Sine(Subtract(a, new AlgebraicInterval(Math.PI / 2, Math.PI / 2)));
-      Assert.AreEqual(Cosine(new AlgebraicInterval(0, 2 * Math.PI)), new AlgebraicInterval(-1, 1));
-      Assert.AreEqual(new AlgebraicInterval(-1, 1), Cosine(new AlgebraicInterval(Math.PI, 4 * Math.PI / 2)));
+      AssertAreEqualInterval(Cosine(new AlgebraicInterval(0, 2 * Math.PI)), new AlgebraicInterval(-1, 1));
+      AssertAreEqualInterval(new AlgebraicInterval(-1, 1), Cosine(new AlgebraicInterval(Math.PI, 4 * Math.PI / 2)));
     }
 
@@ -135,11 +147,11 @@
     public void TestIntervalLogOperator() {
       //Log([3, 5]) = [log(3), log(5)]
-      Assert.AreEqual(new AlgebraicInterval(Math.Log(3), Math.Log(5)), Logarithm(new AlgebraicInterval(3, 5)));
+      AssertAreEqualInterval(new AlgebraicInterval(Math.Log(3), Math.Log(5)), Logarithm(new AlgebraicInterval(3, 5)));
       //Log([0.5, 1]) = [log(0.5), log(1)]
-      Assert.AreEqual(new AlgebraicInterval(Math.Log(0.5), 0), Logarithm(new AlgebraicInterval(0.5, 1)));
+      AssertAreEqualInterval(new AlgebraicInterval(Math.Log(0.5), 0), Logarithm(new AlgebraicInterval(0.5, 1)));
       //Log([-1, 5]) = [NaN, log(5)]
       var result = Logarithm(new AlgebraicInterval(-1, 5));
-      Assert.AreEqual(new AlgebraicInterval(double.NaN, Math.Log(5)),result);
-      
+      AssertAreEqualInterval(new AlgebraicInterval(double.NaN, Math.Log(5)), result);
+
     }
 
@@ -153,5 +165,5 @@
     public void TestIntervalExpOperator() {
       //Exp([0, 1]) = [exp(0), exp(1)]
-      Assert.AreEqual(new AlgebraicInterval(1, Math.Exp(1)), Exponential(new AlgebraicInterval(0, 1)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, Math.Exp(1)), Exponential(new AlgebraicInterval(0, 1)));
     }
 
@@ -164,7 +176,7 @@
     [TestProperty("Time", "short")]
     public void TestIntervalSqrOperator() {
-      Assert.AreEqual(new AlgebraicInterval(1, 4), Square(new AlgebraicInterval(1, 2)));
-      Assert.AreEqual(new AlgebraicInterval(1, 4), Square(new AlgebraicInterval(-2, -1)));
-      Assert.AreEqual(new AlgebraicInterval(0, 4), Square(new AlgebraicInterval(-2, 2)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, 4), Square(new AlgebraicInterval(1, 2)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, 4), Square(new AlgebraicInterval(-2, -1)));
+      AssertAreEqualInterval(new AlgebraicInterval(0, 4), Square(new AlgebraicInterval(-2, 2)));
     }
 
@@ -177,6 +189,6 @@
     [TestProperty("Time", "short")]
     public void TestIntervalSqrtOperator() {
-      Assert.AreEqual(new AlgebraicInterval(1, 2), SquareRoot(new AlgebraicInterval(1, 4)));
-      Assert.AreEqual(new AlgebraicInterval(double.NaN, double.NaN), SquareRoot(new AlgebraicInterval(-4, -1)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, 2), SquareRoot(new AlgebraicInterval(1, 4)));
+      AssertAreEqualInterval(new AlgebraicInterval(double.NaN, double.NaN), SquareRoot(new AlgebraicInterval(-4, -1)));
     }
 
@@ -189,7 +201,7 @@
     [TestProperty("Time", "short")]
     public void TestIntervalCubeOperator() {
-      Assert.AreEqual(new AlgebraicInterval(1, 8), Cube(new AlgebraicInterval(1, 2)));
-      Assert.AreEqual(new AlgebraicInterval(-8, -1), Cube(new AlgebraicInterval(-2, -1)));
-      Assert.AreEqual(new AlgebraicInterval(-8, 8), Cube(new AlgebraicInterval(-2, 2)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, 8), Cube(new AlgebraicInterval(1, 2)));
+      AssertAreEqualInterval(new AlgebraicInterval(-8, -1), Cube(new AlgebraicInterval(-2, -1)));
+      AssertAreEqualInterval(new AlgebraicInterval(-8, 8), Cube(new AlgebraicInterval(-2, 2)));
     }
 
@@ -202,6 +214,6 @@
     [TestProperty("Time", "short")]
     public void TestIntervalCbrtOperator() {
-      Assert.AreEqual(new AlgebraicInterval(1, 2), CubicRoot(new AlgebraicInterval(1, 8)));
-      Assert.AreEqual(new AlgebraicInterval(double.NaN, double.NaN), CubicRoot(new AlgebraicInterval(-8, -1)));
+      AssertAreEqualInterval(new AlgebraicInterval(1, 2), CubicRoot(new AlgebraicInterval(1, 8)));
+      AssertAreEqualInterval(new AlgebraicInterval(double.NaN, double.NaN), CubicRoot(new AlgebraicInterval(-8, -1)));
     }
 
Index: branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/AutoDiffIntervalInterpreterTest.cs
===================================================================
--- branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/AutoDiffIntervalInterpreterTest.cs	(revision 17212)
+++ branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/AutoDiffIntervalInterpreterTest.cs	(revision 17212)
@@ -0,0 +1,185 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Tests {
+  [TestClass]
+  public class AutoDiffIntervalInterpreterTest {
+    private IRegressionProblemData problemData;
+    private IDictionary<string, Interval> variableRanges;
+
+    [TestInitialize]
+    public void InitTest() {
+      double[,] arr = new double[4, 3];
+
+      arr[0, 0] = 3;
+      arr[0, 1] = 6;
+      arr[0, 2] = 2;
+      arr[1, 0] = 5;
+      arr[1, 1] = 2;
+      arr[1, 2] = 1;
+      arr[2, 0] = 8;
+      arr[2, 1] = 5;
+      arr[2, 2] = 0;
+      arr[3, 0] = 3;
+      arr[3, 1] = 4;
+      arr[3, 2] = 2;
+
+      // intervals for dataset
+      // x1: 3 .. 8
+      // x2: 2 .. 6
+
+      var ds = new Dataset(new string[] { "x1", "x2", "y" }, arr);
+      problemData = (IRegressionProblemData)new RegressionProblemData(ds, new string[] { "x1", "x2" }, "y");
+
+
+      variableRanges = new Dictionary<string, Interval>();
+      variableRanges.Add("x1", new Interval(1, 10));
+      variableRanges.Add("x2", new Interval(4, 6));
+    }
+
+    private void EvaluateTest(string expression, Interval expectedResult, IDictionary<string, Interval> variableRanges = null, double lowerDelta = 0, double upperDelta = 0) {
+      var parser = new InfixExpressionParser();
+      var tree = parser.Parse(expression);
+      var interpreter = new IntervalEvaluator();
+      Interval result;
+      if (variableRanges == null) variableRanges = problemData.VariableRanges.GetIntervals();
+      result = interpreter.Evaluate(tree, variableRanges, new ISymbolicExpressionTreeNode[0], out double[] _, out double[] __);
+
+      Assert.AreEqual(expectedResult.LowerBound, result.LowerBound, lowerDelta);
+      Assert.AreEqual(expectedResult.UpperBound, result.UpperBound, upperDelta);
+    }
+
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterAdd() {
+      EvaluateTest("x1 + x2", new Interval(5, 14));
+      EvaluateTest("x1 + x2", new Interval(5, 16), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterLogAdd() {
+      EvaluateTest("log(x1 + x2)", new Interval(Math.Log(5), Math.Log(14)));
+      EvaluateTest("log(x1 + x2)", new Interval(Math.Log(5), Math.Log(16)), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterLogAddMul() {
+      EvaluateTest("log(3*x1 + x2)", new Interval(Math.Log(11), Math.Log(30)));
+      EvaluateTest("log(3*x1 + x2)", new Interval(Math.Log(7), Math.Log(36)), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterSin() {
+      EvaluateTest("sin(x1+x2)", new Interval(-1, 1));
+      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);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterCos() {
+      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)));
+
+      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() {
+      throw new NotSupportedException();
+      // 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]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterExp() {
+      EvaluateTest("exp(x1-x2)", new Interval(Math.Exp(-3), Math.Exp(6)));
+      EvaluateTest("exp(x1-x2)", new Interval(Math.Exp(-5), Math.Exp(6)), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterExpRoot() {
+      EvaluateTest("exp(sqrt(x1*x2))", new Interval(Math.Exp(Math.Sqrt(6)), Math.Exp(Math.Sqrt(48))));
+      EvaluateTest("exp(sqrt(x1*x2))", new Interval(Math.Exp(Math.Sqrt(4)), Math.Exp(Math.Sqrt(60))), variableRanges);
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis.Symbolic")]
+    [TestProperty("Time", "short")]
+    public void TestIntervalInterpreterSqr() {
+      EvaluateTest("sqr(x)", new Interval(Math.Pow(3, 2), Math.Pow(8, 2)));
+    }
+  }
+}
Index: branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Tests.csproj
===================================================================
--- branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 17211)
+++ branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 17212)
@@ -112,4 +112,8 @@
       <HintPath>..\bin\ALGLIB-3.7.0.dll</HintPath>
       <Private>False</Private>
+    </Reference>
+    <Reference Include="HEAL.Attic, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\HEAL.Attic.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.Algorithms.ALPS-3.3">
@@ -605,4 +609,5 @@
     <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\DeriveTest.cs" />
     <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\InfixExpressionParserTest.cs" />
+    <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\AutoDiffIntervalInterpreterTest.cs" />
     <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\IntervalInterpreterTest.cs" />
     <Compile Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4\SymbolicExpressionTreeBottomUpSimilarityCalculatorTest.cs" />
