Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/InterpreterState.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 16654)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs	(revision 16654)
@@ -0,0 +1,291 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HEAL.Attic;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StorableType("DE6C1E1E-D7C1-4070-847E-63B68562B10C")]
+  [Item("IntervalInterpreter", "Intperter for calculation of intervals of symbolic models.")]
+  public sealed class IntervalInterpreter : ParameterizedNamedItem, IStatefulItem {
+
+    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
+
+    public IFixedValueParameter<IntValue> EvaluatedSolutionsParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
+    }
+
+    public int EvaluatedSolutions {
+      get { return EvaluatedSolutionsParameter.Value.Value; }
+      set { EvaluatedSolutionsParameter.Value.Value = value; }
+    }
+
+    [StorableConstructor]
+    private IntervalInterpreter(StorableConstructorFlag _) : base(_) { }
+    private IntervalInterpreter(IntervalInterpreter original, Cloner cloner)
+        : base(original, cloner) { }
+
+    public IntervalInterpreter()
+        : base("IntervalInterpreter", "Intperter for calculation of intervals of symbolic models.") {
+      Parameters.Add(new FixedValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new IntervalInterpreter(this, cloner);
+    }
+
+    private readonly object syncRoot = new object();
+
+    #region IStatefulItem Members
+    public void InitializeState() {
+      EvaluatedSolutions = 0;
+    }
+    public void ClearState() { }
+    #endregion
+
+    public Interval GetSymbolicExressionTreeInterval(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) {
+      var variableRanges = DatasetUtil.GetVariableRanges(dataset, rows);
+      return GetSymbolicExressionTreeIntervals(tree, variableRanges, out nodeIntervals);
+    }
+
+    public Interval GetSymbolicExressionTreeInterval(ISymbolicExpressionTree tree, Dictionary<string, Interval> variableRanges) {
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+      }
+      int instructionCount = 0;
+      var instructions = PrepareInterpreterState(tree, variableRanges);
+      var outputInterval = Evaluate(instructions, ref instructionCount);
+
+      // 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 GetSymbolicExressionTreeIntervals(ISymbolicExpressionTree tree,
+      Dictionary<string, Interval> variableRanges, out Dictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals) {
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+      }
+      int instructionCount = 0;
+      var intervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
+      var instructions = PrepareInterpreterState(tree, variableRanges);
+      var outputInterval = Evaluate(instructions, ref instructionCount, intervals);
+
+      // 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, Dictionary<string, Interval> variableRanges) {
+      if (variableRanges == null)
+        throw new ArgumentNullException("No variablew ranges are present!", nameof(variableRanges));
+
+      //Check if all variables used in the tree are present in the dataset
+      foreach (var variable in tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(n => n.VariableName).Distinct()) {
+        if (!variableRanges.ContainsKey(variable)) throw new InvalidOperationException($"No ranges for variable {variable} is present");
+      }
+
+      Instruction[] code = SymbolicExpressionTreeCompiler.Compile(tree, OpCodes.MapSymbolToOpCode);
+      foreach (Instruction instr in code.Where(i => i.opCode == OpCodes.Variable)) {
+        var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
+        instr.data = variableRanges[variableTreeNode.VariableName];
+      }
+      return code;
+    }
+
+    private Interval Evaluate(Instruction[] instructions, ref int instructionCounter, Dictionary<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
+      //Update instructionCounter, whenever Evaluate is called
+      instructionCounter++;
+      Interval result = null;
+
+      switch (currentInstr.opCode) {
+        //Variables, Constants, ...
+        case OpCodes.Variable: {
+            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
+            var weightInterval = new Interval(variableTreeNode.Weight, variableTreeNode.Weight);
+            var variableInterval = (Interval)currentInstr.data;
+
+            result = Interval.Multiply(variableInterval, weightInterval);
+            break;
+          }
+        case OpCodes.Constant: {
+            var constTreeNode = (ConstantTreeNode)currentInstr.dynamicNode;
+            result = new Interval(constTreeNode.Value, constTreeNode.Value);
+            break;
+          }
+        //Elementary arithmetic rules
+        case OpCodes.Add: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Add(result, argumentInterval);
+            }
+            break;
+          }
+        case OpCodes.Sub: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            if (currentInstr.nArguments == 1)
+              result = Interval.Multiply(new Interval(-1, -1), result);
+
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Subtract(result, argumentInterval);
+            }
+            break;
+          }
+        case OpCodes.Mul: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Multiply(result, argumentInterval);
+            }
+            break;
+          }
+        case OpCodes.Div: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            if (currentInstr.nArguments == 1)
+              result = Interval.Divide(new Interval(1, 1), result);
+
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Divide(result, argumentInterval);
+            }
+            break;
+          }
+        //Trigonometric functions
+        case OpCodes.Sin: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Sine(argumentInterval);
+            break;
+          }
+        case OpCodes.Cos: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Cosine(argumentInterval);
+            break;
+          }
+        case OpCodes.Tan: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Tangens(argumentInterval);
+            break;
+          }
+        //Exponential functions
+        case OpCodes.Log: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Logarithm(argumentInterval);
+            break;
+          }
+        case OpCodes.Exp: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Exponential(argumentInterval);
+            break;
+          }
+        case OpCodes.Power: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Power(result, argumentInterval);
+            }
+            break;
+          }
+        case OpCodes.Square: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.Square(argumentInterval);
+            break;
+          }
+        case OpCodes.Root: {
+            result = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            for (int i = 1; i < currentInstr.nArguments; i++) {
+              var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+              result = Interval.Root(result, argumentInterval);
+            }
+            break;
+          }
+        case OpCodes.SquareRoot: {
+            var argumentInterval = Evaluate(instructions, ref instructionCounter, nodeIntervals);
+            result = Interval.SquareRoot(argumentInterval);
+            break;
+          }
+        default:
+          throw new NotSupportedException($"The tree contains the unknown symbol {currentInstr.dynamicNode.Symbol}");
+      }
+
+      if (nodeIntervals != null)
+        nodeIntervals.Add(currentInstr.dynamicNode, result);
+
+      return result;
+    }
+
+    public static bool IsCompatible(ISymbolicExpressionTree tree) {
+      var containsUnknownSyumbol = (
+        from n in tree.Root.GetSubtree(0).IterateNodesPrefix()
+        where
+          !(n.Symbol is StartSymbol) &&
+          !(n.Symbol is Addition) &&
+          !(n.Symbol is Subtraction) &&
+          !(n.Symbol is Multiplication) &&
+          !(n.Symbol is Division) &&
+          !(n.Symbol is Sine) &&
+          !(n.Symbol is Cosine) &&
+          !(n.Symbol is Tangent) &&
+          !(n.Symbol is Logarithm) &&
+          !(n.Symbol is Exponential) &&
+          !(n.Symbol is Power) &&
+          !(n.Symbol is Square) &&
+          !(n.Symbol is Root) &&
+          !(n.Symbol is SquareRoot) &&
+          !(n.Symbol is Problems.DataAnalysis.Symbolic.Variable) &&
+          !(n.Symbol is Constant)
+        select n).Any();
+      return !containsUnknownSyumbol;
+    }
+  }
+}
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -30,8 +30,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
+  [StorableType("DFA06F28-E224-4D93-9907-69792D24D1F9")]
   [Item("SymbolicDataAnalysisExpressionCompiledTreeInterpreter", "Interpreter that converts the tree into a Linq.Expression then compiles it.")]
   public sealed class SymbolicDataAnalysisExpressionCompiledTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
@@ -98,6 +98,5 @@
 
     [StorableConstructor]
-    private SymbolicDataAnalysisExpressionCompiledTreeInterpreter(bool deserializing)
-      : base(deserializing) {
+    private SymbolicDataAnalysisExpressionCompiledTreeInterpreter(StorableConstructorFlag _) : base(_) {
     }
 
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs	(revision 16654)
@@ -8,5 +8,5 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 using static HeuristicLab.Problems.DataAnalysis.Symbolic.BatchOperations;
@@ -14,5 +14,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   [Item("SymbolicDataAnalysisExpressionTreeBatchInterpreter", "An interpreter that uses batching and vectorization techniques to achieve faster performance.")]
-  [StorableClass]
+  [StorableType("BEB15146-BB95-4838-83AC-6838543F017B")]
   public class SymbolicDataAnalysisExpressionTreeBatchInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
     private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
@@ -37,7 +37,6 @@
     }
 
-
     [StorableConstructor]
-    protected SymbolicDataAnalysisExpressionTreeBatchInterpreter(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionTreeBatchInterpreter(StorableConstructorFlag _) : base(_) { }
     protected SymbolicDataAnalysisExpressionTreeBatchInterpreter(SymbolicDataAnalysisExpressionTreeBatchInterpreter original, Cloner cloner) : base(original, cloner) {
     }
@@ -178,8 +177,14 @@
     }
 
+    private readonly object syncRoot = new object();
+
     [ThreadStatic]
     private Dictionary<string, double[]> cachedData;
 
+    [ThreadStatic]
+    private IDataset dataset;
+
     private void InitCache(IDataset dataset) {
+      this.dataset = dataset;
       cachedData = new Dictionary<string, double[]>();
       foreach (var v in dataset.DoubleVariables) {
@@ -190,14 +195,17 @@
     public void InitializeState() {
       cachedData = null;
+      dataset = null;
       EvaluatedSolutions = 0;
     }
 
     private double[] GetValues(ISymbolicExpressionTree tree, IDataset dataset, int[] rows) {
+      if (cachedData == null || this.dataset != dataset) {
+        InitCache(dataset);
+      }
+
       var code = Compile(tree, dataset, OpCodes.MapSymbolToOpCode);
       var remainingRows = rows.Length % BATCHSIZE;
       var roundedTotal = rows.Length - remainingRows;
 
-      // TODO: evaluated solutions are not counted
-
       var result = new double[rows.Length];
 
@@ -212,11 +220,13 @@
       }
 
+      // when evaluation took place without any error, we can increment the counter
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+      }
+
       return result;
     }
 
     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, int[] rows) {
-      if (cachedData == null) {
-        InitCache(dataset);
-      }
       return GetValues(tree, dataset, rows);
     }
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -30,8 +30,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
+  [StorableType("426718E3-2A57-4CA4-98A1-65EDD0B0BDBF")]
   [Item("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.")]
   public sealed class SymbolicDataAnalysisExpressionTreeILEmittingInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
@@ -104,5 +104,5 @@
 
     [StorableConstructor]
-    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(bool deserializing) : base(deserializing) { }
+    private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(StorableConstructorFlag _) : base(_) { }
 
     private SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(SymbolicDataAnalysisExpressionTreeILEmittingInterpreter original, Cloner cloner) : base(original, cloner) { }
@@ -425,5 +425,5 @@
             Label c1 = il.DefineLabel();
             CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
             il.Emit(System.Reflection.Emit.OpCodes.Cgt);
             il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1);
@@ -440,10 +440,10 @@
             CompileInstructions(il, state, ds);
             for (int i = 1; i < nArgs; i++) {
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
               il.Emit(System.Reflection.Emit.OpCodes.Cgt);
               il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
               CompileInstructions(il, state, ds);
             }
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
             il.Emit(System.Reflection.Emit.OpCodes.Cgt);
             il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
@@ -465,5 +465,5 @@
               // complex definition because of special properties of NaN  
               il.Emit(System.Reflection.Emit.OpCodes.Dup);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // <= 0        
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // <= 0        
               il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch);
               il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch);
@@ -473,5 +473,5 @@
             }
             il.MarkLabel(resultBranch);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
             il.Emit(System.Reflection.Emit.OpCodes.Cgt);
             il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch);
@@ -486,5 +486,5 @@
         case OpCodes.NOT: {
             CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
             il.Emit(System.Reflection.Emit.OpCodes.Cgt);
             il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
@@ -498,10 +498,10 @@
         case OpCodes.XOR: {
             CompileInstructions(il, state, ds);
-            il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0);
             il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
 
             for (int i = 1; i < nArgs; i++) {
               CompileInstructions(il, state, ds);
-              il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
+              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0);
               il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
               il.Emit(System.Reflection.Emit.OpCodes.Xor);
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -28,8 +27,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
+  [StorableType("FB94F333-B32A-44FB-A561-CBDE76693D20")]
   [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
   public class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem,
@@ -70,5 +69,5 @@
 
     [StorableConstructor]
-    protected SymbolicDataAnalysisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { }
+    protected SymbolicDataAnalysisExpressionTreeInterpreter(StorableConstructorFlag _) : base(_) { }
 
     protected SymbolicDataAnalysisExpressionTreeInterpreter(SymbolicDataAnalysisExpressionTreeInterpreter original,
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -28,8 +28,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
+  [StorableType("EF325166-E03A-44C4-83CE-7F07B836285E")]
   [Item("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Fast linear (non-recursive) interpreter for symbolic expression trees. Does not support ADFs.")]
   public sealed class SymbolicDataAnalysisExpressionTreeLinearInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
@@ -70,6 +70,5 @@
 
     [StorableConstructor]
-    private SymbolicDataAnalysisExpressionTreeLinearInterpreter(bool deserializing)
-      : base(deserializing) {
+    private SymbolicDataAnalysisExpressionTreeLinearInterpreter(StorableConstructorFlag _) : base(_) {
       interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
     }
Index: branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs
===================================================================
--- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs	(revision 16531)
+++ branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs	(revision 16654)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -29,8 +29,8 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [StorableClass]
+  [StorableType("91723319-8F15-4D33-B277-40AC7C7CF9AE")]
   [Item("SymbolicDataAnalysisExpressionTreeNativeInterpreter", "An interpreter that wraps a native dll")]
   public class SymbolicDataAnalysisExpressionTreeNativeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
@@ -57,6 +57,5 @@
 
     [StorableConstructor]
-    protected SymbolicDataAnalysisExpressionTreeNativeInterpreter(bool deserializing) : base(deserializing) { }
-
+    protected SymbolicDataAnalysisExpressionTreeNativeInterpreter(StorableConstructorFlag _) : base(_) { }
 
     protected SymbolicDataAnalysisExpressionTreeNativeInterpreter(SymbolicDataAnalysisExpressionTreeNativeInterpreter original, Cloner cloner) : base(original, cloner) {
@@ -99,12 +98,11 @@
     private static Dictionary<string, GCHandle> cachedData;
 
+    [ThreadStatic]
+    private IDataset dataset;
+
     public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, IEnumerable<int> rows) {
       if (!rows.Any()) return Enumerable.Empty<double>();
 
-      lock (syncRoot) {
-        EvaluatedSolutions++; // increment the evaluated solutions counter
-      }
-
-      if (cachedData == null) {
+      if (cachedData == null || this.dataset != dataset) {
         InitCache(dataset);
       }
@@ -116,8 +114,25 @@
 
       NativeWrapper.GetValuesVectorized(code, code.Length, rowsArray, rowsArray.Length, result);
+
+      // when evaluation took place without any error, we can increment the counter
+      lock (syncRoot) {
+        EvaluatedSolutions++;
+      }
+
       return result;
     }
 
     private void InitCache(IDataset dataset) {
+      this.dataset = dataset;
+
+      // free handles to old data
+      if (cachedData != null) {
+        foreach (var gch in cachedData.Values) {
+          gch.Free();
+        }
+        cachedData = null;
+      }
+
+      // cache new data
       cachedData = new Dictionary<string, GCHandle>();
       foreach (var v in dataset.DoubleVariables) {
@@ -135,4 +150,5 @@
         cachedData = null;
       }
+      dataset = null;
       EvaluatedSolutions = 0;
     }
