Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/AlgebraicInterval.cs
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/AlgebraicInterval.cs	(revision 17313)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/AlgebraicInterval.cs	(revision 17314)
@@ -9,4 +9,8 @@
   [DebuggerDisplay("[{low.Value}..{high.Value}]")]
   public class AlgebraicInterval : IAlgebraicType<AlgebraicInterval> {
+
+    // turn a double into an interval (of size 0)
+    public static implicit operator AlgebraicInterval(double value) { return new AlgebraicInterval(value, value); }
+
     [DebuggerBrowsable(DebuggerBrowsableState.Never)]
     private MultivariateDual<AlgebraicDouble> low;
@@ -193,4 +197,10 @@
     }
 
+
+    // TODO: move to constants
+    private const double pi_2 = Math.PI / 2.0;
+    private static readonly double[] maxima = new double[] { -3 * pi_2, pi_2, 5 * pi_2 };
+    private static readonly double[] minima = new double[] { -5 * pi_2, -pi_2, 3 * pi_2 };
+
     public AlgebraicInterval AssignSin(AlgebraicInterval a) {
       var lower = a.LowerBound.Value.Value;
@@ -213,7 +223,4 @@
 
       // handle min = -1 and max = 1 cases explicitly
-      var pi_2 = Math.PI / 2.0;
-      var maxima = new double[] { -3 * pi_2, pi_2 };
-      var minima = new double[] { -pi_2, 3 * pi_2 };
 
       // override min and max if necessary
@@ -294,5 +301,5 @@
       if (xs.Length <= 2) throw new ArgumentException("need at least 3 arguments");
       AssignLowAndHigh(xs[0], xs[1]);
-      for(int i=2;i<xs.Length;i++) {
+      for (int i = 2; i < xs.Length; i++) {
         // we must make sure that low and high are different objects when a == b
         if (low.Value.CompareTo(xs[i].Value) > 0) low.Assign(xs[i]);
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 17313)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/AutoDiffIntervalTest.cs	(revision 17314)
@@ -142,4 +142,11 @@
       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)));
+
+      // some random expression that were problematic
+      AssertAreEqualInterval(new AlgebraicInterval(-0.0326026961803847, 1), new AlgebraicInterval(1, 2).Scale(1.73269159006613).Add(9.23027422279119).Cos());
+      AssertAreEqualInterval(new AlgebraicInterval(0.54030230586814, 1), new AlgebraicInterval(1, 2).Scale(3.39318455754522).Cos().IntPower(2).Cos());
+      AssertAreEqualInterval(new AlgebraicInterval(-0.825841274068331, 1), new AlgebraicInterval(1, 2).Scale(-16.7140105366707 * -0.223806041028346).Cos());
+      AssertAreEqualInterval(new AlgebraicInterval(0, 1), new AlgebraicInterval(1, 2).Scale(1.03513653909418).Exp().Cos().IntPower(2));
+      AssertAreEqualInterval(new AlgebraicInterval(-1, 1), new AlgebraicInterval(1, 2).Scale(0.535386838272755).Exp().IntPower(2).Cos());
     }
 
@@ -285,15 +292,16 @@
       };
       var r = eval.Evaluate(t, intervals, paramNodes, out double[] lg, out double[] ug);
-      Assert.AreEqual(XXX, r.LowerBound);
-      Assert.AreEqual(XXX, r.UpperBound);
-
-      Assert.AreEqual(XXX, lg[0]); // x
-      Assert.AreEqual(XXX, ug[0]);
-
-      for  { "x", new Interval(1, 2) },
-        { "y", new Interval(0, 1) },
-
-      0 <> -2,50012500572888E-05 for y in SQR(LOG('y'))
-      0 <> 2, 49987500573946E-05 for x in SQR(LOG('x'))
+      // TODO
+      // Assert.AreEqual(XXX, r.LowerBound);
+      // Assert.AreEqual(XXX, r.UpperBound);
+      // 
+      // Assert.AreEqual(XXX, lg[0]); // x
+      // Assert.AreEqual(XXX, ug[0]);
+      // 
+      // for  { "x", new Interval(1, 2) },
+      //   { "y", new Interval(0, 1) },
+      // 
+      // 0 <> -2,50012500572888E-05 for y in SQR(LOG('y'))
+      // 0 <> 2, 49987500573946E-05 for x in SQR(LOG('x'))
     }
 
@@ -411,15 +419,15 @@
       Assert.AreEqual(3, r.UpperBound);
 
-      Assert.AreEqual(0.0, lg[0]); // x
-      Assert.AreEqual(0.0, ug[0]); XXXX
-
-      t = parser.Parse("sqrt(y)");
+      Assert.AreEqual(2.0 / 3.0, lg[0]); // x
+      Assert.AreEqual(1.0, ug[0]); 
+
+      t = parser.Parse("cuberoot(y)");
       paramNodes = t.IterateNodesPostfix().Where(n => n.SubtreeCount == 0).ToArray();
       r = eval.Evaluate(t, intervals, paramNodes, out lg, out ug);
-      Assert.AreEqual(0.0, r.LowerBound);
-      Assert.AreEqual(0.0, r.UpperBound);
-
-      Assert.AreEqual(0.0, lg[0]); // y
-      Assert.AreEqual(0.0, ug[0], 1e-5);
+      Assert.AreEqual(Math.Pow(1, 1.0/3.0), r.LowerBound);
+      Assert.AreEqual(Math.Pow(2, 1.0 / 3.0), r.UpperBound);
+
+      Assert.AreEqual(1.0 / 3.0, lg[0]); // y
+      Assert.AreEqual(1.0 / 3.0 * Math.Pow(2, 1.0/3.0), ug[0], 1e-5);
 
       t = parser.Parse("sqrt(z)");
@@ -427,8 +435,8 @@
       r = eval.Evaluate(t, intervals, paramNodes, out lg, out ug);
       Assert.AreEqual(0.0, r.LowerBound);
-      Assert.AreEqual(0.0, r.UpperBound);
+      Assert.AreEqual(1.0, r.UpperBound);
 
       Assert.AreEqual(0.0, lg[0]); // z
-      Assert.AreEqual(0.0, ug[0], 1e-5);
+      Assert.AreEqual(1.0/3.0, ug[0], 1e-5);
     }
 
Index: /branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs
===================================================================
--- /branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17313)
+++ /branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17314)
@@ -77,5 +77,5 @@
 
       // [0, 1] / [0, 1]
-      Assert.AreEqual(Interval.Divide(new Interval(0, 1), new Interval(0, 1)), new Interval(1, double.PositiveInfinity)); // returns [NaN, NaN] because of (0 / 0)
+      Assert.AreEqual(expected: new Interval(1, double.PositiveInfinity), actual: Interval.Divide(new Interval(0, 1), new Interval(0, 1))); // returns [NaN, NaN] because of (0 / 0)
     }
 
