Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs	(revision 17071)
@@ -0,0 +1,65 @@
+﻿using System;
+using System.Runtime.InteropServices;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+  public struct NativeInstruction {
+    public byte opcode;
+    public ushort narg;
+    public int childIndex;
+    public double value;
+    public double weight;
+
+    public IntPtr buf;
+    public IntPtr data;
+  }
+
+  public static class NativeWrapper {
+    private const string x86dll = "hl-native-interpreter-msvc-x86.dll";
+    private const string x64dll = "hl-native-interpreter-msvc-x64.dll";
+
+    private readonly static bool is64;
+
+    static NativeWrapper() {
+      is64 = Environment.Is64BitProcess;
+    }
+
+    public static double GetValue(NativeInstruction[] code, int len, int row) {
+      return is64 ? GetValue64(code, len, row) : GetValue32(code, len, row);
+    }
+
+    public static void GetValues(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result) {
+      if (is64)
+        GetValues64(code, len, rows, nRows, result);
+      else
+        GetValues32(code, len, rows, nRows, result);
+    }
+
+    public static void GetValuesVectorized(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result) {
+      if (is64)
+        GetValuesVectorized64(code, len, rows, nRows, result);
+      else
+        GetValuesVectorized32(code, len, rows, nRows, result);
+    }
+
+    // x86
+    [DllImport(x86dll, EntryPoint = "GetValue", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern double GetValue32(NativeInstruction[] code, int len, int row);
+
+    [DllImport(x86dll, EntryPoint = "GetValues", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern void GetValues32(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result);
+
+    [DllImport(x86dll, EntryPoint = "GetValuesVectorized", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern void GetValuesVectorized32(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result);
+
+    // x64
+    [DllImport(x64dll, EntryPoint = "GetValue", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern double GetValue64(NativeInstruction[] code, int len, int row);
+
+    [DllImport(x64dll, EntryPoint = "GetValues", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern void GetValues64(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result);
+
+    [DllImport(x64dll, EntryPoint = "GetValuesVectorized", CallingConvention = CallingConvention.Cdecl)]
+    internal static extern void GetValuesVectorized64(NativeInstruction[] code, int len, int[] rows, int nRows, double[] result);
+  }
+}
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/HeuristicLab.NativeInterpreter-0.1.csproj
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/HeuristicLab.NativeInterpreter-0.1.csproj	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/HeuristicLab.NativeInterpreter-0.1.csproj	(revision 17071)
@@ -0,0 +1,72 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{E05AC63F-6924-4C83-BD0A-EDF3C103C1D8}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="DllImporter.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="hl-native-interpreter-msvc-x64.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="hl-native-interpreter-msvc-x86.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Plugin.cs
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Plugin.cs	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Plugin.cs	(revision 17071)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Plugin("HeuristicLab.NativeInterpreter", "Provides a native (C++) interpreter for symbolic expression trees", "0.0.0.1")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll", PluginFileType.Assembly)]
+  [PluginFile("hl-native-interpreter-msvc-x86.dll", PluginFileType.NativeDll)]
+  [PluginFile("hl-native-interpreter-msvc-x64.dll", PluginFileType.NativeDll)]
+  public class HeuristicLabNativeInterpreterPlugin : PluginBase {
+  }
+}
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Properties/AssemblyInfo.cs
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Properties/AssemblyInfo.cs	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/Properties/AssemblyInfo.cs	(revision 17071)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1")]
+[assembly: AssemblyDescription("A wrapper for a native code implementation of a tree interpreter")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e05ac63f-6924-4c83-bd0a-edf3c103c1d8")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.0.0.1")]
+[assembly: AssemblyFileVersion("0.0.0.1")]
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/.ycm_extra_conf.py
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/.ycm_extra_conf.py	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/.ycm_extra_conf.py	(revision 17071)
@@ -0,0 +1,145 @@
+# Generated by YCM Generator at 2018-11-01 01:38:35.867002
+
+# This file is NOT licensed under the GPLv3, which is the license for the rest
+# of YouCompleteMe.
+#
+# Here's the license text for this file:
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# For more information, please refer to <http://unlicense.org/>
+
+import os
+import ycm_core
+
+flags = [
+    '-x',
+    'c++',
+    '-Dhl_native_interpreter_EXPORTS',
+    '-I/mnt/c/Projects/hl-native-interpreter/src',
+    '-I/mnt/c/Projects/hl-native-interpreter/lib',
+    '-Wall',
+    '-Werror',
+    '-Wextra',
+    '-fdeclspec',
+    '-std=c++14',
+]
+
+
+# Set this to the absolute path to the folder (NOT the file!) containing the
+# compile_commands.json file to use that instead of 'flags'. See here for
+# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
+#
+# You can get CMake to generate this file for you by adding:
+#   set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
+# to your CMakeLists.txt file.
+#
+# Most projects will NOT need to set this to anything; you can just change the
+# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
+compilation_database_folder = ''
+
+if os.path.exists( compilation_database_folder ):
+  database = ycm_core.CompilationDatabase( compilation_database_folder )
+else:
+  database = None
+
+SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
+
+def DirectoryOfThisScript():
+  return os.path.dirname( os.path.abspath( __file__ ) )
+
+
+def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
+  if not working_directory:
+    return list( flags )
+  new_flags = []
+  make_next_absolute = False
+  path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
+  for flag in flags:
+    new_flag = flag
+
+    if make_next_absolute:
+      make_next_absolute = False
+      if not flag.startswith( '/' ):
+        new_flag = os.path.join( working_directory, flag )
+
+    for path_flag in path_flags:
+      if flag == path_flag:
+        make_next_absolute = True
+        break
+
+      if flag.startswith( path_flag ):
+        path = flag[ len( path_flag ): ]
+        new_flag = path_flag + os.path.join( working_directory, path )
+        break
+
+    if new_flag:
+      new_flags.append( new_flag )
+  return new_flags
+
+
+def IsHeaderFile( filename ):
+  extension = os.path.splitext( filename )[ 1 ]
+  return extension in [ '.H', '.h', '.hxx', '.hpp', '.hh' ]
+
+
+def GetCompilationInfoForFile( filename ):
+  # The compilation_commands.json file generated by CMake does not have entries
+  # for header files. So we do our best by asking the db for flags for a
+  # corresponding source file, if any. If one exists, the flags for that file
+  # should be good enough.
+  if IsHeaderFile( filename ):
+    basename = os.path.splitext( filename )[ 0 ]
+    for extension in SOURCE_EXTENSIONS:
+      replacement_file = basename + extension
+      if os.path.exists( replacement_file ):
+        compilation_info = database.GetCompilationInfoForFile(
+          replacement_file )
+        if compilation_info.compiler_flags_:
+          return compilation_info
+    return None
+  return database.GetCompilationInfoForFile( filename )
+
+
+def FlagsForFile( filename, **kwargs ):
+  if database:
+    # Bear in mind that compilation_info.compiler_flags_ does NOT return a
+    # python list, but a "list-like" StringVec object
+    compilation_info = GetCompilationInfoForFile( filename )
+    if not compilation_info:
+      return None
+
+    final_flags = MakeRelativePathsInFlagsAbsolute(
+      compilation_info.compiler_flags_,
+      compilation_info.compiler_working_dir_ )
+
+  else:
+    relative_to = DirectoryOfThisScript()
+    final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
+
+  return {
+    'flags': final_flags,
+    'do_cache': True
+  }
+
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt	(revision 17071)
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.0)
+
+project(
+    hl-native-interpreter
+    VERSION 0.1
+    DESCRIPTION "Native C++ interpreter for HeuristicLab symbolic expression trees"
+    LANGUAGES CXX
+)
+
+add_library(hl-native-interpreter SHARED src/interpreter.cpp)
+target_include_directories(hl-native-interpreter PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/lib)
+target_compile_features(hl-native-interpreter PRIVATE cxx_std_17)
+
+add_library(hl-native-interpreter-vdt SHARED src/interpreter.cpp)
+target_include_directories(hl-native-interpreter-vdt PRIVATE ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/lib)
+target_compile_features(hl-native-interpreter-vdt PRIVATE cxx_std_17)
+
+if(MSVC)
+    target_compile_options(hl-native-interpreter PRIVATE "/W4" "/Qvec-report:2" "/MT" "$<$<CONFIG:Release>:/O2>")
+    target_compile_options(hl-native-interpreter-vdt PRIVATE "/W4" "/Qvec-report:2" "/MT" "$<$<CONFIG:Release>:/O2>")
+    target_compile_definitions(hl-native-interpreter-vdt PRIVATE "USE_VDT")
+else()
+    target_compile_options(hl-native-interpreter PRIVATE "-Wall" "-Wextra" "-Werror" "-fopt-info-vec-optimized" "$<$<CONFIG:Release>:-O3;-march=x86-64>")
+    target_compile_options(hl-native-interpreter-vdt PRIVATE "-Wall" "-Wextra" "-Werror" "-fopt-info-vec-optimized" "$<$<CONFIG:Release>:-O3;-march=x86-64>")
+    target_compile_definitions(hl-native-interpreter-vdt PRIVATE "USE_VDT")
+    set_target_properties(hl-native-interpreter PROPERTIES PREFIX "")
+    set_target_properties(hl-native-interpreter-vdt PROPERTIES PREFIX "")
+endif()
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md	(revision 17071)
@@ -0,0 +1,66 @@
+# Build instructions
+
+1) Create a folder to hold the build 
+
+`mkdir build` 
+
+`cd build`
+
+2) Run CMake 
+
+- Visual Studio
+
+    `cmake -G "Microsoft Visual Studio 15 2017 [arch]" <path-to-repository>`. Leave `arch` empty for x86 or `Win64` for x64. 
+    
+    `cmake --build . --config Release`
+
+- MinGW
+
+    `cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release|Debug`. CMake supports different build types: `Release`, `Debug`, `MinSizeRel` and `RelWithDebInfo`. 
+    
+    `cmake --build .` or `make` or `make VERBOSE=1`
+    
+The build system generates two targets, one using the standard math library functions (`std::exp`, `std::log`, etc.) and the other using functions from the [vdt](https://github.com/dpiparo/vdt) library (described in more detail in [this talk from CERN](https://indico.cern.ch/event/202688/contributions/1487957/attachments/305612/426820/OpenLabFPWorkshop_9_2012.pdf)). A performance comparison with existing HL interpreters is given below. MinGW and MSVC builds of this library were tested. The non-vdt MinGW binary suffers significant peformance loss due to trancendental functions `log` and `exp`. All MinGW binaries also exhibit performance loss with the `pow` and `root` functions. Batched versions take advantage of auto-vectorization. Overall the `Native-MinGW-Vdt[BatchSize=64]` performs the best on the selected grammars. Units in the table correspond to billion node evaluations per second.
+    
+    
+# Performance
+
+## Arithmetic Grammar 
+
+|  Rows | StandardInterpreter | LinerInterpreter | ILEmittingInterpreter | CompiledTreeInterpreter | Native-MSVC-Std | Native-MSVC-Vdt | Native-MinGW-Std | Native-MinGW-Vdt | Native-MSVC-Std[BatchSize=64] | Native-MSVC-Vdt[BatchSize=64] | Native-MinGW-Std[BatchSize=64] | Native-MinGW-Vdt[BatchSize=64] |
+|:-----:|:-------------------:|:----------------:|:---------------------:|:-----------------------:|:---------------:|:---------------:|:----------------:|:----------------:|:-----------------------------:|:-----------------------------:|:------------------------------:|:------------------------------:|
+|  1000 |        0.0430       |      0.2115      |         0.0922        |          0.0817         |      0.5487     |      0.5118     |      0.5512      |      0.5665      |             1.2304            |             1.1942            |             1.1942             |             1.2688             |
+|  2000 |        0.0488       |      0.2048      |         0.1584        |          0.1501         |      0.5845     |      0.5803     |      0.5817      |      0.5668      |             1.3247            |             1.1497            |             1.3693             |             1.3617             |
+|  3000 |        0.0487       |      0.2087      |         0.2142        |          0.2049         |      0.5832     |      0.5678     |      0.5851      |      0.5722      |             1.4745            |             1.2876            |             1.4986             |             1.4986             |
+|  4000 |        0.0488       |      0.2113      |         0.2492        |          0.2423         |      0.4828     |      0.5254     |      0.5472      |      0.5696      |             1.5237            |             1.5190            |             1.4555             |             1.4341             |
+|  5000 |        0.0489       |      0.2072      |         0.2645        |          0.2576         |      0.5394     |      0.4646     |      0.5788      |      0.5618      |             1.3790            |             1.0923            |             1.5276             |             1.5509             |
+|  6000 |        0.0486       |      0.2065      |         0.3038        |          0.3248         |      0.5875     |      0.5861     |      0.5020      |      0.4713      |             1.5239            |             1.0601            |             1.4897             |             1.5399             |
+|  7000 |        0.0489       |      0.2082      |         0.3261        |          0.3518         |      0.5751     |      0.5869     |      0.5805      |      0.5993      |             1.1952            |             1.0627            |             1.2332             |             1.2191             |
+|  8000 |        0.0487       |      0.2086      |         0.3467        |          0.3760         |      0.5890     |      0.5737     |      0.5781      |      0.6024      |             1.3660            |             1.5192            |             1.3622             |             1.4428             |
+|  9000 |        0.0485       |      0.2033      |         0.3653        |          0.3924         |      0.5915     |      0.5918     |      0.5778      |      0.5855      |             1.4990            |             1.5476            |             1.5742             |             1.5325             |
+| 10000 |        0.0486       |      0.2048      |         0.3749        |          0.4080         |      0.5825     |      0.6015     |      0.5797      |      0.6069      |             1.5221            |             1.5671            |             1.4601             |             1.5958             |
+
+## TypeCoherent Grammar
+
+|  Rows | StandardInterpreter | LinerInterpreter | ILEmittingInterpreter | CompiledTreeInterpreter | Native-MSVC-Std | Native-MSVC-Vdt | Native-MinGW-Std | Native-MinGW-Vdt | Native-MSVC-Std[BatchSize=64] | Native-MSVC-Vdt[BatchSize=64] | Native-MinGW-Std[BatchSize=64] | Native-MinGW-Vdt[BatchSize=64] |
+|:-----:|:-------------------:|:----------------:|:---------------------:|:-----------------------:|:---------------:|:---------------:|:----------------:|:----------------:|:-----------------------------:|:-----------------------------:|:------------------------------:|:------------------------------:|
+|  1000 |        0.0435       |      0.1522      |         0.0813        |          0.0732         |      0.3049     |      0.3074     |      0.2419      |      0.3098      |             0.7542            |             0.7928            |             0.3049             |             1.1368             |
+|  2000 |        0.0441       |      0.1569      |         0.1254        |          0.1165         |      0.3066     |      0.3138     |      0.2407      |      0.3170      |             0.7932            |             0.8429            |             0.3199             |             1.2424             |
+|  3000 |        0.0441       |      0.1536      |         0.1521        |          0.1476         |      0.3115     |      0.3088     |      0.2397      |      0.3136      |             0.8595            |             0.8675            |             0.3268             |             1.3074             |
+|  4000 |        0.0440       |      0.1559      |         0.1708        |          0.1692         |      0.3122     |      0.3166     |      0.2420      |      0.3172      |             0.8443            |             0.8918            |             0.3247             |             1.3084             |
+|  5000 |        0.0436       |      0.1543      |         0.1829        |          0.1852         |      0.3119     |      0.3138     |      0.2355      |      0.3175      |             0.8634            |             0.8872            |             0.3165             |             1.3024             |
+|  6000 |        0.0439       |      0.1539      |         0.1950        |          0.1939         |      0.3091     |      0.3060     |      0.2389      |      0.3127      |             0.8758            |             0.9049            |             0.3284             |             1.3058             |
+|  7000 |        0.0437       |      0.1553      |         0.2013        |          0.2055         |      0.3131     |      0.2835     |      0.2403      |      0.3141      |             0.8542            |             0.8989            |             0.3292             |             1.2941             |
+|  8000 |        0.0442       |      0.1530      |         0.2084        |          0.2095         |      0.3109     |      0.3096     |      0.2381      |      0.3132      |             0.8804            |             0.9049            |             0.3286             |             1.3383             |
+|  9000 |        0.0440       |      0.1552      |         0.2127        |          0.2222         |      0.3107     |      0.2944     |      0.2385      |      0.3035      |             0.8359            |             0.9049            |             0.3171             |             1.2707             |
+| 10000 |        0.0439       |      0.1554      |         0.2133        |          0.2274         |      0.3118     |      0.2870     |      0.2385      |      0.3089      |             0.8424            |             0.9023            |             0.3187             |             1.3271             |
+
+
+
+
+
+
+
+
+
+
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/asin.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/asin.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/asin.h	(revision 17071)
@@ -0,0 +1,217 @@
+/*
+ * aasin.h
+ * The basic idea is to exploit Pade' polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ASIN_H_
+#define ASIN_H_
+
+#include "vdtcore_common.h"
+
+namespace vdt{
+
+namespace details{
+
+const double RX1asin = 2.967721961301243206100E-3;
+const double RX2asin = -5.634242780008963776856E-1;
+const double RX3asin = 6.968710824104713396794E0;
+const double RX4asin = -2.556901049652824852289E1;
+const double RX5asin = 2.853665548261061424989E1;
+
+const double SX1asin = -2.194779531642920639778E1;
+const double SX2asin =  1.470656354026814941758E2;
+const double SX3asin = -3.838770957603691357202E2;
+const double SX4asin = 3.424398657913078477438E2;
+
+const double PX1asin = 4.253011369004428248960E-3;
+const double PX2asin = -6.019598008014123785661E-1;
+const double PX3asin = 5.444622390564711410273E0;
+const double PX4asin = -1.626247967210700244449E1;
+const double PX5asin = 1.956261983317594739197E1;
+const double PX6asin = -8.198089802484824371615E0;
+
+const double QX1asin = -1.474091372988853791896E1;
+const double QX2asin =  7.049610280856842141659E1;
+const double QX3asin = -1.471791292232726029859E2;
+const double QX4asin = 1.395105614657485689735E2;
+const double QX5asin = -4.918853881490881290097E1;
+
+inline double getRX(const double x){
+	double rx = RX1asin;
+	rx*= x;
+	rx+= RX2asin;
+	rx*= x;    
+	rx+= RX3asin;
+	rx*= x;    
+	rx+= RX4asin;
+	rx*= x;    
+	rx+= RX5asin;
+	return rx;
+}
+inline double getSX(const double x){
+	double sx = x;
+	sx+= SX1asin;
+	sx*= x;    
+	sx+= SX2asin;
+	sx*= x;    
+	sx+= SX3asin;
+	sx*= x;    
+	sx+= SX4asin;
+	return sx;
+}
+
+inline double getPX(const double x){
+	double px = PX1asin;
+	px*= x;
+	px+= PX2asin;
+	px*= x;    
+	px+= PX3asin;
+	px*= x;    
+	px+= PX4asin;
+	px*= x;    
+	px+= PX5asin;
+	px*= x;    
+	px+= PX6asin;
+	return px;
+}
+
+inline double getQX(const double x){
+	double qx = x;
+	qx+= QX1asin;
+	qx*= x;    
+	qx+= QX2asin;
+	qx*= x;    
+	qx+= QX3asin;
+	qx*= x;    
+	qx+= QX4asin;
+	qx*= x;    
+	qx+= QX5asin;
+	return qx;
+	}
+}
+
+}
+
+namespace vdt{
+
+// asin double precision --------------------------------------------------------
+/// Double Precision asin
+inline double fast_asin(double x){	
+
+	const uint64_t sign_mask = details::getSignMask(x);
+	x = std::fabs(x);
+	const double a = x;
+	
+	
+	double zz = 1.0 - a;
+	double px = details::getRX(zz);
+	double qx = details::getSX(zz);
+
+	const double p = zz * px/qx;
+
+	zz = std::sqrt(zz+zz);
+	double z = details::PIO4 - zz;
+	zz = zz * p - details::MOREBITS;
+	z -= zz;
+	z += details::PIO4;
+	
+	if( a < 0.625 ){
+		zz = a * a;
+		px = details::getPX(zz);
+		qx = details::getQX(zz);
+		z = zz*px/qx;    
+		z = a * z + a;
+	}
+	
+
+	// Linear approx, not sooo needed but seable. Price is cheap though
+	double res = a < 1e-8? a : z ;
+        // Restore Sign	
+	return details::dpORuint64(res,sign_mask);
+
+}
+
+//------------------------------------------------------------------------------
+/// Single Precision asin
+inline float fast_asinf(float x){      
+
+
+    uint32_t flag=0;
+
+    const uint32_t sign_mask = details::getSignMask(x);
+    const float a = std::fabs(x);
+
+    float z;
+    if( a > 0.5f )
+        {
+        z = 0.5f * (1.0f - a);
+        x = sqrtf( z );
+        flag = 1;
+        }
+    else
+        {
+        x = a;
+        z = x * x;
+        }
+        
+    z = (((( 4.2163199048E-2f * z
+            + 2.4181311049E-2f) * z
+            + 4.5470025998E-2f) * z
+            + 7.4953002686E-2f) * z
+            + 1.6666752422E-1f) * z * x
+            + x;
+
+//     if( flag != 0 )
+//       {
+//       z = z + z;
+//       z = PIO2F - z;
+//       }
+
+    // No branch with the two coefficients
+            
+    float tmp = z + z;
+    tmp = details::PIO2F - tmp;
+
+    // Linear approx, not sooo needed but seable. Price is cheap though
+    float res = a < 1e-4f? a : tmp * flag + (1-flag) * z ;
+    
+    // Restore Sign 
+    return details::spORuint32(res,sign_mask);
+
+}
+
+//------------------------------------------------------------------------------
+// The cos is in this file as well
+
+inline double fast_acos( double x ){return details::PIO2  - fast_asin(x);}
+
+//------------------------------------------------------------------------------
+
+inline float fast_acosf( float x ){return details::PIO2F  - fast_asinf(x);}
+
+//------------------------------------------------------------------------------
+
+} //vdt namespace
+
+#endif /* ASIN_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan.h	(revision 17071)
@@ -0,0 +1,163 @@
+/*
+ * atan.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ATAN_H_
+#define ATAN_H_
+
+#include "vdtcore_common.h"
+
+namespace vdt{
+
+namespace details{
+const double T3PO8 = 2.41421356237309504880;
+const double MOREBITSO2 = MOREBITS * 0.5;
+
+inline double get_atan_px(const double x2){
+
+	const double PX1atan = -8.750608600031904122785E-1;
+	const double PX2atan = -1.615753718733365076637E1;
+	const double PX3atan = -7.500855792314704667340E1;
+	const double PX4atan = -1.228866684490136173410E2;
+	const double PX5atan = -6.485021904942025371773E1;
+
+	double px = PX1atan;
+	px *= x2;
+	px += PX2atan;
+	px *= x2;
+	px += PX3atan;
+	px *= x2;
+	px += PX4atan;
+	px *= x2;
+	px += PX5atan;
+
+	return px;
+}
+
+
+inline double get_atan_qx(const double x2){
+	const double QX1atan = 2.485846490142306297962E1;
+	const double QX2atan = 1.650270098316988542046E2;
+	const double QX3atan = 4.328810604912902668951E2;
+	const double QX4atan = 4.853903996359136964868E2;
+	const double QX5atan = 1.945506571482613964425E2;
+
+	double qx=x2;
+	qx += QX1atan;
+	qx *=x2;
+	qx += QX2atan;
+	qx *=x2;
+	qx += QX3atan;
+	qx *=x2;
+	qx += QX4atan;
+	qx *=x2;
+	qx += QX5atan;
+
+	return qx;
+}
+
+}
+
+
+
+/// Fast Atan implementation double precision
+inline double fast_atan(double x){
+
+	/* make argument positive and save the sign */
+	const uint64_t sign_mask = details::getSignMask(x);
+	x=std::fabs(x);
+
+	/* range reduction */
+	const double originalx=x;
+
+	double y = details::PIO4;
+	double factor = details::MOREBITSO2;
+	x = (x-1.0) / (x+1.0);
+
+	if( originalx > details::T3PO8 ) {
+		y = details::PIO2;
+		factor = details::MOREBITS;
+		x = -1.0 / originalx ;
+	}
+	if ( originalx <= 0.66 ) {
+		y = 0.;
+		factor = 0.;
+		x = originalx;
+	}
+
+	const double x2 = x * x;
+
+	const double px = details::get_atan_px(x2);
+	const double qx = details::get_atan_qx(x2);
+
+	//double res = y +x * x2 * px / qx + x +factor;
+
+	const double poq=px / qx;
+
+	double res = x * x2 * poq + x;
+	res+=y;
+
+	res+=factor;
+
+	return details::dpORuint64(res,sign_mask);
+}
+
+//------------------------------------------------------------------------------
+/// Fast Atan implementation single precision
+inline float fast_atanf( float xx ) {
+
+	const uint32_t sign_mask = details::getSignMask(xx);
+
+	float x= std::fabs(xx);
+	const float x0=x;
+	float y=0.0f;
+
+	/* range reduction */
+	if( x0 > 0.4142135623730950f ){ // * tan pi/8
+		x = (x0-1.0f)/(x0+1.0f);
+		y = details::PIO4F;
+	}
+	if( x0 > 2.414213562373095f ){  // tan 3pi/8
+		x = -( 1.0f/x0 );
+		y = details::PIO2F;
+	}
+
+
+	const float x2 = x * x;
+	y +=
+			((( 8.05374449538e-2f * x2
+					- 1.38776856032E-1f) * x2
+					+ 1.99777106478E-1f) * x2
+					- 3.33329491539E-1f) * x2 * x
+					+ x;
+
+	return details::spORuint32(y,sign_mask);
+}
+
+//------------------------------------------------------------------------------
+
+}// end of vdt
+
+#endif // end of atan
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan2.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan2.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/atan2.h	(revision 17071)
@@ -0,0 +1,143 @@
+/*
+ * atan2.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code.
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ *
+ *  Created on: Sept 20, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/*
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ATAN2_H_
+#define ATAN2_H_
+
+#include "vdtcore_common.h"
+#include "atan.h"
+
+namespace vdt{
+
+inline double fast_atan2( double y, double x ) {
+    // move in first octant
+    double xx = std::fabs(x);
+    double yy = std::fabs(y);
+    double tmp (0.0);
+    if (yy>xx) {
+        tmp = yy;
+        yy=xx; xx=tmp;
+        tmp=1.;
+    }
+
+    // To avoid the fpe, we protect against /0.
+    const double oneIfXXZero = (xx==0.);
+    double t=yy/(xx+oneIfXXZero);
+    double z=t;
+
+    double s = details::PIO4;
+    double factor = details::MOREBITSO2;
+    t = (t-1.0) / (t+1.0);
+
+    if( z > details::T3PO8 ) {
+        s = details::PIO2;
+        factor = details::MOREBITS;
+        t = -1.0 / z ;
+    }
+    if ( z <= 0.66 ) {
+        s = 0.;
+        factor = 0.;
+        t = z;
+    }
+
+    const double t2 = t * t;
+
+    const double px = details::get_atan_px(t2);
+    const double qx = details::get_atan_qx(t2);
+
+    //double res = y +x * x2 * px / qx + x +factor;
+
+    const double poq=px / qx;
+
+    double ret = t * t2 * poq + t;
+    ret+=s;
+
+    ret+=factor;
+
+    // Here we put the result to 0 if xx was 0, if not nothing happens!
+    ret*= (1.-oneIfXXZero);
+
+    // move back in place
+    if (y==0) ret=0.0;
+    if (tmp!=0) ret = details::PIO2 - ret;
+    if (x<0) ret = details::PI - ret;
+    if (y<0) ret = -ret;
+
+
+    return ret;
+}
+
+inline float fast_atan2f( float y, float x ) {
+
+    // move in first octant
+    float xx = std::fabs(x);
+    float yy = std::fabs(y);
+    float tmp (0.0f);
+    if (yy>xx) {
+        tmp = yy;
+        yy=xx; xx=tmp;
+        tmp =1.f;
+    }
+
+    // To avoid the fpe, we protect against /0.
+    const float oneIfXXZero = (xx==0.f);
+    
+    float t=yy/(xx/*+oneIfXXZero*/);
+    float z=t;
+    if( t > 0.4142135623730950f ) // * tan pi/8
+            z = (t-1.0f)/(t+1.0f);
+
+    //printf("%e %e %e %e\n",yy,xx,t,z);
+    float z2 = z * z;
+    
+    float ret =(((( 8.05374449538e-2f * z2
+                    - 1.38776856032E-1f) * z2
+                    + 1.99777106478E-1f) * z2
+                    - 3.33329491539E-1f) * z2 * z
+                    + z );
+
+    // Here we put the result to 0 if xx was 0, if not nothing happens!
+    ret*= (1.f - oneIfXXZero);
+    
+    // move back in place
+    if (y==0.f) ret=0.f;
+    if( t > 0.4142135623730950f ) ret += details::PIO4F;
+    if (tmp!=0) ret = details::PIO2F - ret;
+    if (x<0.f) ret = details::PIF - ret;
+    if (y<0.f) ret = -ret;
+
+    return ret;
+
+}
+
+
+
+//------------------------------------------------------------------------------
+
+} // end namespace vdt
+
+
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/cos.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/cos.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/cos.h	(revision 17071)
@@ -0,0 +1,32 @@
+/*
+ * cos.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+#ifndef COS_H_
+#define COS_H_
+
+#include "sincos.h"
+
+namespace vdt{
+
+// Cos double precision --------------------------------------------------------
+
+/// Double precision cosine: just call sincos.
+inline double fast_cos(double x){double s,c;fast_sincos(x,s,c);return c;}
+
+//------------------------------------------------------------------------------
+
+inline float fast_cosf(float x){float s,c;fast_sincosf(x,s,c);return c;}
+
+//------------------------------------------------------------------------------
+
+} //vdt namespace
+
+#endif /* COS_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h	(revision 17071)
@@ -0,0 +1,157 @@
+/*
+ * exp.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _VDT_EXP_
+#define _VDT_EXP_
+
+#include "vdtcore_common.h"
+#include <limits>
+
+namespace vdt{
+
+namespace details{
+  
+  const double EXP_LIMIT = 708;
+
+  const double PX1exp = 1.26177193074810590878E-4;
+  const double PX2exp = 3.02994407707441961300E-2;
+  const double PX3exp = 9.99999999999999999910E-1;
+  const double QX1exp = 3.00198505138664455042E-6;
+  const double QX2exp = 2.52448340349684104192E-3;
+  const double QX3exp = 2.27265548208155028766E-1;
+  const double QX4exp = 2.00000000000000000009E0;
+
+  const double LOG2E = 1.4426950408889634073599; // 1/log(2)
+
+  const float MAXLOGF = 88.72283905206835f;
+  const float MINLOGF = -88.f;
+
+  const float C1F =   0.693359375f;
+  const float C2F =  -2.12194440e-4f;
+
+  const float PX1expf = 1.9875691500E-4f;
+  const float PX2expf =1.3981999507E-3f;
+  const float PX3expf =8.3334519073E-3f;
+  const float PX4expf =4.1665795894E-2f;
+  const float PX5expf =1.6666665459E-1f;
+  const float PX6expf =5.0000001201E-1f;
+
+  const float LOG2EF = 1.44269504088896341f;
+
+}
+
+// Exp double precision --------------------------------------------------------
+
+
+/// Exponential Function double precision
+inline double fast_exp(double initial_x){
+
+    double x = initial_x;
+    double px=details::fpfloor(details::LOG2E * x +0.5);
+ 
+    const int32_t n = int32_t(px);
+
+    x -= px * 6.93145751953125E-1;
+    x -= px * 1.42860682030941723212E-6;
+
+    const double xx = x * x;
+
+    // px = x * P(x**2).
+    px = details::PX1exp;
+    px *= xx;
+    px += details::PX2exp;
+    px *= xx;
+    px += details::PX3exp;
+    px *= x;
+
+    // Evaluate Q(x**2).
+    double qx = details::QX1exp;
+    qx *= xx;
+    qx += details::QX2exp;
+    qx *= xx;
+    qx += details::QX3exp;
+    qx *= xx;
+    qx += details::QX4exp;
+
+    // e**x = 1 + 2x P(x**2)/( Q(x**2) - P(x**2) )
+    x = px / (qx - px);
+    x = 1.0 + 2.0 * x;
+
+    // Build 2^n in double.
+    x *= details::uint642dp(( ((uint64_t)n) +1023)<<52);
+
+    if (initial_x > details::EXP_LIMIT)
+            x = std::numeric_limits<double>::infinity();
+    if (initial_x < -details::EXP_LIMIT)
+            x = 0.;
+
+    return x;
+    
+}
+
+// Exp single precision --------------------------------------------------------
+
+/// Exponential Function single precision
+inline float fast_expf(float initial_x) {
+	
+    float x = initial_x;
+
+    float z = details::fpfloor( details::LOG2EF * x +0.5f ); /* floor() truncates toward -infinity. */
+
+    x -= z * details::C1F;
+    x -= z * details::C2F;
+    const int32_t n = int32_t ( z );
+
+    const float x2 = x * x;
+
+    z = x*details::PX1expf;
+    z += details::PX2expf;
+    z *= x;
+    z += details::PX3expf;
+    z *= x;
+    z += details::PX4expf;
+    z *= x;
+    z += details::PX5expf;
+    z *= x;
+    z += details::PX6expf;
+    z *= x2;
+    z += x + 1.0f;
+
+    /* multiply by power of 2 */
+    z *=  details::uint322sp((n+0x7f)<<23);
+
+    if (initial_x > details::MAXLOGF) z=std::numeric_limits<float>::infinity();
+    if (initial_x < details::MINLOGF) z=0.f;
+
+    return z;
+
+  }
+
+//------------------------------------------------------------------------------
+
+} // end namespace vdt
+
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/inv.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/inv.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/inv.h	(revision 17071)
@@ -0,0 +1,92 @@
+/*
+ * inv.h
+ * An experiment: implement division with the square fo the approximate 
+ * inverse square root.
+ * In other words one transforms a shift, multiplications and sums into a 
+ * sqrt.
+ * 
+ *  Created on: Jun 24, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ * 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef INV_H_
+#define INV_H_
+
+#include "vdtcore_common.h"
+#include "sqrt.h"
+#include <cmath>
+#include <limits>
+
+namespace vdt{
+
+//------------------------------------------------------------------------------
+
+/// General implementation of the inversion
+inline double fast_inv_general(double x, const uint32_t isqrt_iterations) {  
+  const uint64_t sign_mask = details::getSignMask(x);
+  const double sqrt_one_over_x = fast_isqrt_general(std::fabs(x),
+                                                   isqrt_iterations);
+  return sqrt_one_over_x*(details::dpORuint64(sqrt_one_over_x , sign_mask ));
+}
+
+//------------------------------------------------------------------------------
+
+/// Four iterations inversion
+inline double fast_inv(double x) {return fast_inv_general(x,4);}
+
+//------------------------------------------------------------------------------
+
+/// Three iterations
+inline double fast_approx_inv(double x) {return fast_inv_general(x,3);}
+
+//------------------------------------------------------------------------------
+
+/// For comparisons
+inline double inv (double x) {return 1./x;}
+
+//------------------------------------------------------------------------------
+// Single precision          
+
+
+
+/// General implementation of the inversion
+inline float fast_invf_general(float x, const uint32_t isqrt_iterations) { 
+  const uint32_t sign_mask = details::getSignMask(x);
+  const float sqrt_one_over_x = fast_isqrtf_general(std::fabs(x),
+                                                   isqrt_iterations);
+  return sqrt_one_over_x*(details::spORuint32(sqrt_one_over_x , sign_mask ));
+}
+
+//------------------------------------------------------------------------------
+
+/// Two iterations
+inline float fast_invf(float x) {return fast_invf_general(x,2);}
+
+//------------------------------------------------------------------------------
+
+/// One iterations
+inline float fast_approx_invf(float x) {return fast_invf_general(x,1);}
+
+//------------------------------------------------------------------------------
+
+/// For comparisons
+inline float invf (float x) {return 1.f/x;}
+
+//------------------------------------------------------------------------------
+
+} // end namespace vdt
+
+#endif /* INV_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/log.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/log.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/log.h	(revision 17071)
@@ -0,0 +1,207 @@
+/*
+ * log.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOG_H_
+#define LOG_H_
+
+#include "vdtcore_common.h"
+#include <limits>
+
+namespace vdt{
+
+// local namespace for the constants/functions which are necessary only here
+namespace details{
+
+const double LOG_UPPER_LIMIT = 1e307;
+const double LOG_LOWER_LIMIT = 0;
+
+const double SQRTH = 0.70710678118654752440;
+
+inline double get_log_px(const double x){
+	const double PX1log = 1.01875663804580931796E-4;
+	const double PX2log = 4.97494994976747001425E-1;
+	const double PX3log = 4.70579119878881725854E0;
+	const double PX4log = 1.44989225341610930846E1;
+	const double PX5log = 1.79368678507819816313E1;
+	const double PX6log = 7.70838733755885391666E0;
+
+	double px = PX1log;
+	px *= x;
+	px += PX2log;
+	px *= x;
+	px += PX3log;
+	px *= x;
+	px += PX4log;
+	px *= x;
+	px += PX5log;
+	px *= x;
+	px += PX6log;
+	return px;
+
+}
+
+inline double get_log_qx(const double x){
+	const double QX1log = 1.12873587189167450590E1;
+	const double QX2log = 4.52279145837532221105E1;
+	const double QX3log = 8.29875266912776603211E1;
+	const double QX4log = 7.11544750618563894466E1;
+	const double QX5log = 2.31251620126765340583E1;
+
+	double qx = x;
+	qx += QX1log;
+	qx *=x;
+	qx += QX2log;
+	qx *=x;
+	qx += QX3log;
+	qx *=x;
+	qx += QX4log;
+	qx *=x;
+	qx += QX5log;
+	return qx;
+}
+
+}
+
+// Log double precision --------------------------------------------------------
+inline double fast_log(double x){
+
+	const double original_x = x;
+
+	/* separate mantissa from exponent */
+	double fe;
+	x = details::getMantExponent(x,fe);
+
+	// blending
+	x > details::SQRTH? fe+=1. : x+=x ;
+	x -= 1.0;
+
+	/* rational form */
+	double px =  details::get_log_px(x);
+
+	//for the final formula
+	const double x2 = x*x;
+	px *= x;
+	px *= x2;
+
+	const double qx = details::get_log_qx(x);
+
+	double res = px / qx ;
+
+	res -= fe * 2.121944400546905827679e-4;
+	res -= 0.5 * x2  ;
+
+	res = x + res;
+	res += fe * 0.693359375;
+
+	if (original_x > details::LOG_UPPER_LIMIT)
+		res = std::numeric_limits<double>::infinity();
+	if (original_x < details::LOG_LOWER_LIMIT) // THIS IS NAN!
+		res =  - std::numeric_limits<double>::quiet_NaN();
+
+	return res;
+
+}
+
+// Log single precision --------------------------------------------------------
+
+
+
+namespace details{
+
+const float LOGF_UPPER_LIMIT = MAXNUMF;
+const float LOGF_LOWER_LIMIT = 0;
+
+const float PX1logf = 7.0376836292E-2f;
+const float PX2logf	= -1.1514610310E-1f;
+const float PX3logf	= 1.1676998740E-1f;
+const float PX4logf	= -1.2420140846E-1f;
+const float PX5logf	= 1.4249322787E-1f;
+const float PX6logf	= -1.6668057665E-1f;
+const float PX7logf	= 2.0000714765E-1f;
+const float PX8logf	= -2.4999993993E-1f;
+const float PX9logf	= 3.3333331174E-1f;
+
+inline float get_log_poly(const float x){
+	float y = x*PX1logf;
+	y += PX2logf;
+	y *= x;
+	y += PX3logf;
+	y *= x;
+	y += PX4logf;
+	y *= x;
+	y += PX5logf;
+	y *= x;
+	y += PX6logf;
+	y *= x;
+	y += PX7logf;
+	y *= x;
+	y += PX8logf;
+	y *= x;
+	y += PX9logf;
+	return y;
+}
+
+const float SQRTHF = 0.707106781186547524f;
+
+}
+
+// Log single precision --------------------------------------------------------
+inline float fast_logf( float x ) {
+
+	const float original_x = x;
+
+	float fe;
+	x = details::getMantExponentf( x, fe);
+
+	x > details::SQRTHF? fe+=1.f : x+=x ;
+	x -= 1.0f;
+
+	const float x2 = x*x;
+
+	float res = details::get_log_poly(x);
+	res *= x2*x;
+
+	res += -2.12194440e-4f * fe;
+	res +=  -0.5f * x2;
+
+	res= x + res;
+
+	res += 0.693359375f * fe;
+
+	if (original_x > details::LOGF_UPPER_LIMIT)
+		res = std::numeric_limits<float>::infinity();
+	if (original_x < details::LOGF_LOWER_LIMIT)
+		res = -std::numeric_limits<float>::quiet_NaN();
+
+	return res;
+}
+
+
+//------------------------------------------------------------------------------
+
+} //vdt namespace
+
+#endif /* LOG_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sin.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sin.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sin.h	(revision 17071)
@@ -0,0 +1,48 @@
+/*
+ * cos.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SIN_H_
+#define SIN_H_
+
+#include "sincos.h"
+
+namespace vdt{
+
+// Sin double precision --------------------------------------------------------
+
+/// Double precision sine: just call sincos.
+inline double fast_sin(double x){double s,c;fast_sincos(x,s,c);return s;}
+
+//------------------------------------------------------------------------------
+
+inline float fast_sinf(float x){float s,c;fast_sincosf(x,s,c);return s;}
+
+//------------------------------------------------------------------------------
+
+
+} //vdt namespace
+
+#endif /* SIN_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sincos.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sincos.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sincos.h	(revision 17071)
@@ -0,0 +1,238 @@
+/*
+ * sincos_common.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "vdtcore_common.h"
+#include <cmath>
+#include <limits>
+
+#ifndef SINCOS_COMMON_H_
+#define SINCOS_COMMON_H_
+
+namespace vdt{
+
+namespace details{
+
+// double precision constants
+
+const double DP1sc = 7.85398125648498535156E-1;
+const double DP2sc = 3.77489470793079817668E-8;
+const double DP3sc = 2.69515142907905952645E-15;
+
+const double C1sin = 1.58962301576546568060E-10;
+const double C2sin =-2.50507477628578072866E-8;
+const double C3sin = 2.75573136213857245213E-6;
+const double C4sin =-1.98412698295895385996E-4;
+const double C5sin = 8.33333333332211858878E-3;
+const double C6sin =-1.66666666666666307295E-1;
+
+const double C1cos =-1.13585365213876817300E-11;
+const double C2cos = 2.08757008419747316778E-9;
+const double C3cos =-2.75573141792967388112E-7;
+const double C4cos = 2.48015872888517045348E-5;
+const double C5cos =-1.38888888888730564116E-3;
+const double C6cos = 4.16666666666665929218E-2;
+
+const double DP1 = 7.853981554508209228515625E-1;
+const double DP2 = 7.94662735614792836714E-9;
+const double DP3 = 3.06161699786838294307E-17;
+
+// single precision constants 
+
+const float DP1F = 0.78515625;
+const float DP2F = 2.4187564849853515625e-4;
+const float DP3F = 3.77489497744594108e-8;
+
+const float T24M1 = 16777215.;
+
+//------------------------------------------------------------------------------
+
+inline double get_sin_px(const double x){
+	double px=C1sin;
+	px *= x;
+	px += C2sin;
+	px *= x;
+	px += C3sin;
+	px *= x;
+	px += C4sin;
+	px *= x;
+	px += C5sin;
+	px *= x;
+	px += C6sin;
+	return px;
+}
+
+//------------------------------------------------------------------------------
+
+inline double get_cos_px(const double x){
+	double px=C1cos;
+	px *= x;
+	px += C2cos;
+	px *= x;
+	px += C3cos;
+	px *= x;
+	px += C4cos;
+	px *= x;
+	px += C5cos;
+	px *= x;
+	px += C6cos;
+	return px;
+}
+
+
+//------------------------------------------------------------------------------
+/// Reduce to 0 to 45
+inline double reduce2quadrant(double x, int32_t& quad) {
+
+    x = fabs(x);
+    quad = int (ONEOPIO4 * x); // always positive, so (int) == std::floor
+    quad = (quad+1) & (~1);    
+    const double y = double (quad);
+    // Extended precision modular arithmetic
+    return ((x - y * DP1) - y * DP2) - y * DP3;
+  }
+
+//------------------------------------------------------------------------------
+/// Sincos only for -45deg < x < 45deg
+inline void fast_sincos_m45_45( const double z, double & s, double &c ) {
+
+    double zz = z * z;    
+    s = z  +  z * zz * get_sin_px(zz);                
+    c = 1.0 - zz * .5 + zz * zz * get_cos_px(zz);
+  }
+
+
+//------------------------------------------------------------------------------
+
+} // End namespace details
+
+/// Double precision sincos
+inline void fast_sincos( const double xx, double & s, double &c ) {
+    // I have to use doubles to make it vectorise...
+
+    int j;
+    double x = details::reduce2quadrant(xx,j);
+    const double signS = (j&4); 
+
+    j-=2;
+
+    const double signC = (j&4);
+    const double poly = j&2;
+
+    details::fast_sincos_m45_45(x,s,c);
+    
+    //swap
+    if( poly==0 ) {
+      const double tmp = c;
+      c=s; 
+      s=tmp;
+    }
+
+    if(signC == 0.) 
+      c = -c;
+    if(signS != 0.) 
+      s = -s;
+    if (xx < 0.)  
+      s = -s;
+
+  }
+
+
+// Single precision functions
+
+namespace details {
+//------------------------------------------------------------------------------
+/// Reduce to 0 to 45
+inline float reduce2quadrant(float x, int & quad) {
+    /* make argument positive */
+    x = fabs(x);
+
+    quad = int (ONEOPIO4F * x); /* integer part of x/PIO4 */
+
+    quad = (quad+1) & (~1);
+    const float y = float(quad);
+    // quad &=4;
+    // Extended precision modular arithmetic
+    return ((x - y * DP1F) - y * DP2F) - y * DP3F;
+  }
+  
+  
+//------------------------------------------------------------------------------
+
+
+
+/// Sincos only for -45deg < x < 45deg
+inline void fast_sincosf_m45_45( const float x, float & s, float &c ) {
+
+    float z = x * x;
+
+    s = (((-1.9515295891E-4f * z
+       + 8.3321608736E-3f) * z
+      - 1.6666654611E-1f) * z * x)
+      + x;
+
+    c = ((  2.443315711809948E-005f * z
+        - 1.388731625493765E-003f) * z
+     + 4.166664568298827E-002f) * z * z
+      - 0.5f * z + 1.0f;
+  }
+
+//------------------------------------------------------------------------------
+
+} // end details namespace
+
+/// Single precision sincos
+inline void fast_sincosf( const float xx, float & s, float &c ) {
+	
+
+    int j;
+    const float x = details::reduce2quadrant(xx,j);
+    int signS = (j&4); 
+
+    j-=2;
+
+    const int signC = (j&4);
+    const int poly = j&2;
+
+    float ls,lc;
+    details::fast_sincosf_m45_45(x,ls,lc);
+
+    //swap
+    if( poly==0 ) {
+      const float tmp = lc;
+      lc=ls; ls=tmp;
+    }
+
+    if(signC == 0) lc = -lc;
+    if(signS != 0) ls = -ls;
+    if (xx<0)  ls = -ls;
+    c=lc;
+    s=ls;
+  }
+
+
+} // end namespace vdt
+
+#endif 
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sqrt.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sqrt.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/sqrt.h	(revision 17071)
@@ -0,0 +1,99 @@
+/*
+ * sqrt.h
+ * Implementations born on the Quake 3 fast inverse square root 
+ * function.
+ * http://en.wikipedia.org/wiki/Fast_inverse_square_root
+ * 
+ *  Created on: Jun 24, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SQRT_H_
+#define SQRT_H_
+
+#include "vdtcore_common.h"
+
+namespace vdt{
+
+//------------------------------------------------------------------------------
+
+
+/// Sqrt implmentation from Quake3
+inline double fast_isqrt_general(double x, const uint32_t ISQRT_ITERATIONS) {
+
+  const double threehalfs = 1.5;
+  const double x2 = x * 0.5;
+  double y  = x;
+  uint64_t i  = details::dp2uint64(y);
+  // Evil!
+  i  = 0x5fe6eb50c7aa19f9ULL  - ( i >> 1 );
+  y  = details::uint642dp(i);
+  for (uint32_t j=0;j<ISQRT_ITERATIONS;++j)
+      y *= threehalfs - ( x2 * y * y ) ;
+
+  return y;
+}
+
+//------------------------------------------------------------------------------
+
+/// Four iterations
+inline double fast_isqrt(double x) {return fast_isqrt_general(x,4);}
+
+/// Three iterations
+inline double fast_approx_isqrt(double x) {return fast_isqrt_general(x,3);}
+
+//------------------------------------------------------------------------------
+
+/// For comparisons
+inline double isqrt (double x) {return 1./std::sqrt(x);}
+
+//------------------------------------------------------------------------------
+
+/// Sqrt implmentation from Quake3
+inline float fast_isqrtf_general(float x, const uint32_t ISQRT_ITERATIONS) {
+
+	const float threehalfs = 1.5f;
+	const float x2 = x * 0.5f;
+	float y  = x;
+	uint32_t i  = details::sp2uint32(y);
+	i  = 0x5f3759df - ( i >> 1 );
+	y  = details::uint322sp(i);
+	for (uint32_t j=0;j<ISQRT_ITERATIONS;++j)
+		y  *= ( threehalfs - ( x2 * y * y ) );
+
+	return y;
+}
+
+//------------------------------------------------------------------------------
+
+/// Two iterations
+inline float fast_isqrtf(float x) {return fast_isqrtf_general(x,2);}
+
+/// One (!) iterations
+inline float fast_approx_isqrtf(float x) {return fast_isqrtf_general(x,1);}
+
+//------------------------------------------------------------------------------
+
+/// For comparisons
+inline float isqrtf (float x) {return 1.f/std::sqrt(x);}
+
+//------------------------------------------------------------------------------
+
+} // end namespace vdt
+
+#endif /* SQRT_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/stdwrap.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/stdwrap.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/stdwrap.h	(revision 17071)
@@ -0,0 +1,30 @@
+#ifndef _VDT_STD_H_
+#define _VDT_STD_H_
+
+#include <cmath>
+
+// wrapper around std function just to benefit of naming
+// to be used in vectorized wrappers
+
+namespace vdt {
+  
+  template<typename T>
+  inline T fast_sqrt(T x) { return std::sqrt(x); }
+
+  template<typename T>
+  inline T fast_div(T x,T y) { return x/y; }
+
+  template<typename T>
+  inline T fast_fma(T x,T y, T z) { return x*y+z; }
+
+  // correclty rounded
+  template<typename T>
+  inline T fast_fmac(T x, T y, T z) { return std::fma(x,y,z); }
+  
+  template<typename T>
+  inline T fast_pow(T x, T y) { return std::pow(x, y); }
+
+  template<typename T>
+  inline T fast_round(T x) { return std::round(x); }
+}
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tan.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tan.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tan.h	(revision 17071)
@@ -0,0 +1,171 @@
+/*
+ * tan.h
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code. 
+ * The Cephes library can be found here:  http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TAN_H_
+#define TAN_H_
+
+#include "vdtcore_common.h"
+#include "sincos.h"
+
+namespace vdt{
+
+
+namespace details{
+
+const double PX1tan=-1.30936939181383777646E4;
+const double PX2tan=1.15351664838587416140E6;
+const double PX3tan=-1.79565251976484877988E7;
+
+const double QX1tan = 1.36812963470692954678E4;
+const double QX2tan = -1.32089234440210967447E6;
+const double QX3tan = 2.50083801823357915839E7;
+const double QX4tan = -5.38695755929454629881E7;
+
+const double DP1tan = 7.853981554508209228515625E-1;
+const double DP2tan = 7.94662735614792836714E-9;
+const double DP3tan = 3.06161699786838294307E-17;
+
+const float DP1Ftan = 0.78515625;
+const float DP2Ftan = 2.4187564849853515625e-4;
+const float DP3Ftan = 3.77489497744594108e-8;
+
+
+//------------------------------------------------------------------------------
+/// Reduce to -45 to 45
+inline double reduce2quadranttan(double x, int32_t& quad) {
+
+    x = fabs(x);
+    quad = int( ONEOPIO4 * x ); // always positive, so (int) == std::floor
+    quad = (quad+1) & (~1);
+    const double y = quad;
+    // Extended precision modular arithmetic
+    return ((x - y * DP1tan) - y * DP2tan) - y * DP3tan;
+  }
+
+//------------------------------------------------------------------------------
+/// Reduce to -45 to 45
+inline float reduce2quadranttan(float x, int32_t& quad) {
+
+    x = fabs(x);
+    quad = int( ONEOPIO4F * x ); // always positive, so (int) == std::floor
+    quad = (quad+1) & (~1);
+    const float y = quad;
+    // Extended precision modular arithmetic
+    return ((x - y * DP1Ftan) - y * DP2Ftan) - y * DP3Ftan;
+  }
+
+}
+
+//------------------------------------------------------------------------------
+/// Double precision tangent implementation
+inline double fast_tan(double x){
+
+    const uint64_t sign_mask = details::getSignMask(x);
+
+    int32_t quad =0;
+    const double z=details::reduce2quadranttan(x,quad);
+
+    const double zz = z * z;
+
+    double res=z;
+
+    if( zz > 1.0e-14 ){
+        double px = details::PX1tan;
+        px *= zz;
+        px += details::PX2tan;
+        px *= zz;
+        px += details::PX3tan;
+
+        double qx=zz;
+        qx += details::QX1tan;
+        qx *=zz; 
+        qx += details::QX2tan;
+        qx *=zz;
+        qx += details::QX3tan;
+        qx *=zz;
+        qx += details::QX4tan;
+
+        res = z + z * zz * px / qx;
+    }
+
+    // A no branching way to say: if j&2 res = -1/res. You can!!!
+    quad &=2;
+    quad >>=1;
+    const int32_t alt = quad^1;
+    // Avoid fpe generated by 1/0 if res is 0
+    const double zeroIfXNonZero = (x==0.);
+    res += zeroIfXNonZero;
+    res = quad * (-1./res) + alt * res; // one coeff is one and one is 0!
+
+    // Again, return 0 if res==0, the correct result otherwhise
+    return details::dpXORuint64(res,sign_mask) * (1.-zeroIfXNonZero);
+
+}
+
+// Single precision ------------------------------------------------------------
+
+inline float fast_tanf(float x){
+    const uint32_t sign_mask = details::getSignMask(x);
+
+    int32_t quad =0;
+    const float z=details::reduce2quadranttan(x,quad);
+
+    const float zz = z * z;
+
+    float res=z;
+
+    if( zz > 1.0e-14f ){
+      res =
+        ((((( 9.38540185543E-3f * zz
+        + 3.11992232697E-3f) * zz
+        + 2.44301354525E-2f) * zz
+        + 5.34112807005E-2f) * zz
+        + 1.33387994085E-1f) * zz
+        + 3.33331568548E-1f) * zz * z
+        + z;
+    }
+
+    // A no branching way to say: if j&2 res = -1/res. You can!!!
+    quad &=2;
+    quad >>=1;
+    const int32_t alt = quad^1;
+    // Avoid fpe generated by 1/0 if res is 0
+    const float zeroIfXNonZero = (x==0.f);
+    res += zeroIfXNonZero;
+    res = quad * (-1.f/res) + alt * res; // one coeff is one and one is 0!
+
+    return details::spXORuint32(res,sign_mask) * (1.f-zeroIfXNonZero);
+
+}
+
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+
+} //vdt namespace
+
+
+#endif /* TAN_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tanh.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tanh.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/tanh.h	(revision 17071)
@@ -0,0 +1,77 @@
+/*
+ * tanh.h
+ * The basic idea is to exploit Pade polynomials.
+ * Implemented by Manuel Schiller for LHCb.
+ * 
+ *  Created on: Sep 23, 2017
+ *      Author: Paul Seyfert, Manuel Schiller
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TANH_H_
+#define TANH_H_
+
+#include "vdtcore_common.h"
+
+namespace vdt{
+
+
+
+
+/// Fast tanh implementation double precision
+inline double fast_tanh(double x){
+	// for very large |x| > 20, tanh(x) is x/|x| anyway (at least to double
+	// precision)
+	//
+	// NB: branch-free code takes longer to execute
+	if (std::abs(x) > 20.) return std::copysign(1., x);
+	// strategy for large arguments: tanh(2x) = 2 tanh(x)/(1 + tanh^2(x))
+	// idea is to use this "argument halving" a couple of times, and use a
+	// very short PadÃ© approximation for the rest of the way
+	const auto xx = x * 0.125;
+	const auto xx2 = xx * xx;
+	const auto numer = 135135 + xx2 * (17325 + xx2 * ( 378 + xx2 *  1));
+	const auto denom = 135135 + xx2 * (62370 + xx2 * (3150 + xx2 * 28));
+
+	auto tanh = xx * numer / denom;
+	tanh = 2 * tanh / (tanh * tanh + 1);
+	tanh = 2 * tanh / (tanh * tanh + 1);
+	return 2 * tanh / (tanh * tanh + 1);
+}
+
+//------------------------------------------------------------------------------
+/// Fast tanh implementation single precision
+inline float fast_tanhf( float x ) {
+	// same strategy as double version above, but even shorter PadÃ©
+	// approximation is sufficient for float
+	//
+	// NB: branch-free code takes longer to execute
+	if (std::abs(x) > 9.1f) return std::copysign(1.f, x);
+	const auto xx = x * 0.125f;
+	const auto xx2 = xx * xx;
+	auto tanh = xx * (xx2 + 15) / (6 * xx2 + 15);
+	tanh = 2 * tanh / (tanh * tanh + 1);
+	tanh = 2 * tanh / (tanh * tanh + 1);
+	return 2 * tanh / (tanh * tanh + 1);
+}
+
+//------------------------------------------------------------------------------
+// Vector signatures
+
+}// end of vdt
+
+#endif // end of tanh
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtMath.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtMath.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtMath.h	(revision 17071)
@@ -0,0 +1,23 @@
+#ifndef _VDT_MATH_H_
+#define _VDT_MATH_H_
+
+// Include all the VDT fucntions
+
+#include "sin.h"
+#include "asin.h"
+
+#include "cos.h"
+
+#include "tan.h"
+#include "tanh.h"
+#include "atan.h"
+#include "atan2.h"
+
+#include "exp.h"
+#include "log.h"
+
+#include "sqrt.h"
+
+#include "inv.h"
+
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtcore_common.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtcore_common.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/vdtcore_common.h	(revision 17071)
@@ -0,0 +1,243 @@
+/*
+ * vdtcore_common.h
+ * Common functions for the vdt routines.
+ * The basic idea is to exploit Pade polynomials.
+ * A lot of ideas were inspired by the cephes math library (by Stephen L. Moshier
+ * moshier@na-net.ornl.gov) as well as actual code for the exp, log, sin, cos, 
+ * tan, asin, acos and atan functions. The Cephes library can be found here:
+ * http://www.netlib.org/cephes/
+ * 
+ *  Created on: Jun 23, 2012
+ *      Author: Danilo Piparo, Thomas Hauth, Vincenzo Innocente
+ */
+
+/* 
+ * VDT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program 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 Lesser Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef VDTCOMMON_H_
+#define VDTCOMMON_H_
+
+#include <cinttypes>
+#include <cmath>
+
+namespace vdt{
+
+namespace details{
+
+// Constants
+const double TWOPI = 2.*M_PI;
+const double PI = M_PI;
+const double PIO2 = M_PI_2;
+const double PIO4 = M_PI_4;
+const double ONEOPIO4 = 4./M_PI;
+
+const float TWOPIF = 2.*M_PI;
+const float PIF = M_PI;
+const float PIO2F = M_PI_2;
+const float PIO4F = M_PI_4;
+const float ONEOPIO4F = 4./M_PI;
+
+const double MOREBITS = 6.123233995736765886130E-17;
+
+
+const float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
+
+//------------------------------------------------------------------------------
+
+/// Used to switch between different type of interpretations of the data (64 bits)
+union ieee754{
+	inline ieee754 () {};
+	inline ieee754 (double thed) {d=thed;};
+	inline ieee754 (uint64_t thell) {ll=thell;};
+	inline ieee754 (float thef) {f[0]=thef;};
+	inline ieee754 (uint32_t thei) {i[0]=thei;};
+  double d;
+  float f[2];
+  uint32_t i[2];
+  uint64_t ll;
+  uint16_t s[4];
+};
+
+//------------------------------------------------------------------------------
+
+/// Converts an unsigned long long to a double
+inline double uint642dp(uint64_t ll) {
+  ieee754 tmp;
+  tmp.ll=ll;
+  return tmp.d;
+}
+
+//------------------------------------------------------------------------------
+
+/// Converts a double to an unsigned long long
+inline uint64_t dp2uint64(double x) {
+  ieee754 tmp;
+  tmp.d=x;
+  return tmp.ll;
+}
+
+//------------------------------------------------------------------------------
+/// Makes an AND of a double and a unsigned long long
+inline double dpANDuint64(const double x, const uint64_t i ){
+  return uint642dp(dp2uint64(x) & i); 
+}
+//------------------------------------------------------------------------------
+/// Makes an OR of a double and a unsigned long long
+inline double dpORuint64(const double x, const uint64_t i ){
+  return uint642dp(dp2uint64(x) | i); 
+}
+
+/// Makes a XOR of a double and a unsigned long long
+inline double dpXORuint64(const double x, const uint64_t i ){
+  return uint642dp(dp2uint64(x) ^ i); 
+}
+
+//------------------------------------------------------------------------------
+inline uint64_t getSignMask(const double x){
+  const uint64_t mask=0x8000000000000000ULL;
+  return dp2uint64(x) & mask;
+}
+
+//------------------------------------------------------------------------------
+/// Converts an int to a float
+inline float uint322sp(int x) {
+    ieee754 tmp;
+    tmp.i[0]=x;
+    return tmp.f[0];
+  }
+
+//------------------------------------------------------------------------------
+/// Converts a float to an int
+inline uint32_t sp2uint32(float x) {
+    ieee754 tmp;
+    tmp.f[0]=x;
+    return tmp.i[0];
+  }
+
+//------------------------------------------------------------------------------
+/// Makes an AND of a float and a unsigned long
+inline float spANDuint32(const float x, const uint32_t i ){
+  return uint322sp(sp2uint32(x) & i); 
+}
+//------------------------------------------------------------------------------
+/// Makes an OR of a float and a unsigned long
+inline float spORuint32(const float x, const uint32_t i ){
+  return uint322sp(sp2uint32(x) | i); 
+}
+
+//------------------------------------------------------------------------------
+/// Makes an OR of a float and a unsigned long
+inline float spXORuint32(const float x, const uint32_t i ){
+  return uint322sp(sp2uint32(x) ^ i); 
+}
+//------------------------------------------------------------------------------
+/// Get the sign mask
+inline uint32_t getSignMask(const float x){
+  const uint32_t mask=0x80000000;
+  return sp2uint32(x) & mask;
+}
+
+//------------------------------------------------------------------------------
+/// Like frexp but vectorising and the exponent is a double.
+inline double getMantExponent(const double x, double & fe){
+
+  uint64_t n = dp2uint64(x);
+
+  // Shift to the right up to the beginning of the exponent.
+  // Then with a mask, cut off the sign bit
+  uint64_t le = (n >> 52);
+
+  // chop the head of the number: an int contains more than 11 bits (32)
+  int32_t e = le; // This is important since sums on uint64_t do not vectorise
+  fe = e-1023 ;
+
+  // This puts to 11 zeroes the exponent
+  n &=0x800FFFFFFFFFFFFFULL;
+  // build a mask which is 0.5, i.e. an exponent equal to 1022
+  // which means *2, see the above +1.
+  const uint64_t p05 = 0x3FE0000000000000ULL; //dp2uint64(0.5);
+  n |= p05;
+
+  return uint642dp(n);
+}
+
+//------------------------------------------------------------------------------
+/// Like frexp but vectorising and the exponent is a float.
+inline float getMantExponentf(const float x, float & fe){
+
+    uint32_t n = sp2uint32(x);
+    int32_t e = (n >> 23)-127;
+    fe = e;
+
+    // fractional part
+    const uint32_t p05f = 0x3f000000; // //sp2uint32(0.5);
+    n &= 0x807fffff;// ~0x7f800000;
+    n |= p05f;
+
+    return uint322sp(n);
+
+}
+
+//------------------------------------------------------------------------------
+/// Converts a fp to an int
+inline uint32_t fp2uint(float x) {
+    return sp2uint32(x);
+  }
+/// Converts a fp to an int
+inline uint64_t fp2uint(double x) {
+    return dp2uint64(x);
+  }
+/// Converts an int to fp
+inline float int2fp(uint32_t i) {
+    return uint322sp(i);
+  }
+/// Converts an int to fp
+inline double int2fp(uint64_t i) {
+    return uint642dp(i);
+  }
+
+//------------------------------------------------------------------------------
+/**
+ * A vectorisable floor implementation, not only triggered by fast-math.
+ * These functions do not distinguish between -0.0 and 0.0, so are not IEC6509 
+ * compliant for argument -0.0
+**/ 
+inline double fpfloor(const double x){
+  // no problem since exp is defined between -708 and 708. Int is enough for it!
+  int32_t ret = int32_t (x);
+  ret-=(sp2uint32(x)>>31);  
+  return ret;
+
+}
+//------------------------------------------------------------------------------
+/**
+ * A vectorisable floor implementation, not only triggered by fast-math.
+ * These functions do not distinguish between -0.0 and 0.0, so are not IEC6509 
+ * compliant for argument -0.0
+**/ 
+inline float fpfloor(const float x){
+  int32_t ret = int32_t (x);
+  ret-=(sp2uint32(x)>>31);  
+  return ret;
+
+}
+
+//------------------------------------------------------------------------------
+
+}
+
+} // end of namespace vdt
+
+#endif /* VDTCOMMON_H_ */
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/instruction.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/instruction.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/instruction.h	(revision 17071)
@@ -0,0 +1,45 @@
+#ifndef INSTRUCTION_H
+#define INSTRUCTION_H
+
+#include <cstdint>
+
+#include "vector_operations.h"
+
+enum OpCodes : uint8_t
+{
+    // same values as in OpCodes.cs
+    Add = 1,
+    Sub = 2,
+    Mul = 3,
+    Div = 4,
+    Sin = 5,
+    Cos = 6,
+    Tan = 7,
+    Log = 8,
+    Exp = 9,
+    Var = 18,
+    Const = 20,
+    Power = 22,
+    Root = 23,
+    Square = 28,
+    Sqrt = 29
+};
+
+struct instruction
+{
+    // from Instruction.cs
+    uint8_t opcode;
+    uint16_t narg;
+
+    int childIndex;
+
+    // from LinearInstruction.cs
+    double value;
+    double weight; // necessary for variables
+
+    // pointer to data
+    double *buf;
+    double *data;
+};
+
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp	(revision 17071)
@@ -0,0 +1,60 @@
+#include "interpreter.h" 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+constexpr size_t BUFSIZE = BATCHSIZE * sizeof(double);
+
+// slow (ish?)
+__declspec(dllexport) 
+double __cdecl GetValue(instruction* code, int codeLength, int row) noexcept
+{
+    return evaluate(code, codeLength, row);
+}
+
+__declspec(dllexport) 
+void __cdecl GetValues(instruction* code, int codeLength, int* rows, int totalRows, double* result) noexcept
+{
+    for (int i = 0; i < totalRows; ++i)
+    {
+        result[i] = evaluate(code, codeLength, rows[i]);
+    }
+}
+
+__declspec(dllexport)
+void __cdecl GetValuesVectorized(instruction* code, int codeLength, int* rows, int totalRows, double* __restrict result) noexcept
+{
+    double* buffer = static_cast<double*>(_aligned_malloc(codeLength * BUFSIZE, 16));
+    for (int i = 0; i < codeLength; ++i)
+    {
+        instruction& in = code[i];
+        in.buf = buffer + (i * BATCHSIZE);
+
+        if (in.opcode == OpCodes::Const)
+        {
+            load(in.buf, in.value);
+        }
+    }
+
+    int remainingRows = totalRows % BATCHSIZE;
+    int total = totalRows - remainingRows;
+
+    for (int rowIndex = 0; rowIndex < total; rowIndex += BATCHSIZE)
+    {
+        evaluate(code, codeLength, rows, rowIndex, BATCHSIZE);
+        std::memcpy(result + rowIndex, code[0].buf, BUFSIZE);
+    }
+
+    // are there any rows left?
+    if (remainingRows > 0) 
+    {
+        evaluate(code, codeLength, rows, total, remainingRows);
+        std::memcpy(result + total, code[0].buf, remainingRows * sizeof(double));
+    }
+    _aligned_free(buffer);
+}
+
+#ifdef __cplusplus
+}
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h	(revision 17071)
@@ -0,0 +1,241 @@
+#ifndef NATIVE_TREE_INTERPRETER_CLANG_H
+#define NATIVE_TREE_INTERPRETER_CLANG_H
+
+#include "vector_operations.h"
+#include "instruction.h"
+
+inline double evaluate(instruction *code, int len, int row) noexcept
+{
+    for (int i = len - 1; i >= 0; --i)
+    {
+        instruction &in = code[i];
+        switch (in.opcode)
+        {
+            case OpCodes::Var:
+                {
+                    in.value = in.weight * in.data[row];
+                    break;
+                }
+            case OpCodes::Add:
+                {
+                    in.value = code[in.childIndex].value;
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        in.value += code[in.childIndex + j].value;
+                    }
+                    break;
+                }
+            case OpCodes::Sub:
+                {
+                    in.value = code[in.childIndex].value;
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        in.value -= code[in.childIndex + j].value;
+                    }
+                    if (in.narg == 1)
+                    {
+                        in.value = -in.value;
+                    }
+                    break;
+                }
+            case OpCodes::Mul:
+                {
+                    in.value = code[in.childIndex].value;
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        in.value *= code[in.childIndex + j].value;
+                    }
+                    break;
+                }
+            case OpCodes::Div:
+                {
+                    in.value = code[in.childIndex].value;
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        in.value /= code[in.childIndex + j].value;
+                    }
+                    if (in.narg == 1)
+                    {
+                        in.value = 1 / in.value;
+                    }
+                    break;
+                }
+            case OpCodes::Exp:
+                {
+                    in.value = std::exp(code[in.childIndex].value);
+                    break;
+                }
+            case OpCodes::Log:
+                {
+                    in.value = std::log(code[in.childIndex].value);
+                    break;
+                }
+            case OpCodes::Sin:
+                {
+                    in.value = std::sin(code[in.childIndex].value);
+                    break;
+                }
+            case OpCodes::Cos:
+                {
+                    in.value = std::cos(code[in.childIndex].value);
+                    break;
+                }
+            case OpCodes::Tan:
+                {
+                    in.value = std::tan(code[in.childIndex].value);
+                    break;
+                }
+            case OpCodes::Power:
+                {
+                    double x = code[in.childIndex].value;
+                    double y = std::round(code[in.childIndex + 1].value);
+                    in.value = std::pow(x, y);
+                    break;
+                }
+            case OpCodes::Root:
+                {
+                    double x = code[in.childIndex].value;
+                    double y = std::round(code[in.childIndex + 1].value);
+                    in.value = std::pow(x, 1 / y);
+                    break;
+                }
+            case OpCodes::Square:
+                {
+                    in.value = std::pow(code[in.childIndex].value, 2.);
+                    break;
+                }
+            case OpCodes::Sqrt:
+                {
+                    in.value = std::sqrt(code[in.childIndex].value);
+                    break;
+                }
+        }
+    }
+    return code[0].value;
+}
+
+inline void load_data(instruction &in, int* __restrict rows, int rowIndex, int batchSize) noexcept
+{
+    for (int i = 0; i < batchSize; ++i)
+    {
+        auto row = rows[rowIndex + i];
+        in.buf[i] = in.weight * in.data[row];
+    }
+}
+
+inline void evaluate(instruction* code, int len, int* __restrict rows, int rowIndex, int batchSize) noexcept
+{
+    for (int i = len - 1; i >= 0; --i)
+    {
+        instruction &in = code[i];
+        switch (in.opcode)
+        {
+            case OpCodes::Var:
+                {
+                    load_data(in, rows, rowIndex, batchSize); // buffer data
+                    break;
+                }
+            case OpCodes::Add:
+                {
+                    load(in.buf, code[in.childIndex].buf);
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        add(in.buf, code[in.childIndex + j].buf);
+                    }
+                    break;
+                }
+            case OpCodes::Sub:
+                {
+                    if (in.narg == 1)
+                    {
+                        neg(in.buf, code[in.childIndex].buf);
+                        break;
+                    }
+                    else
+                    {
+                        load(in.buf, code[in.childIndex].buf);
+                        for (int j = 1; j < in.narg; ++j)
+                        {
+                            sub(in.buf, code[in.childIndex + j].buf);
+                        }
+                    }
+                    break;
+                }
+            case OpCodes::Mul:
+                {
+                    load(in.buf, code[in.childIndex].buf);
+                    for (int j = 1; j < in.narg; ++j)
+                    {
+                        mul(in.buf, code[in.childIndex + j].buf);
+                    }
+                    break;
+                }
+            case OpCodes::Div:
+                {
+                    if (in.narg == 1)
+                    {
+                        inv(in.buf, code[in.childIndex].buf);
+                        break;
+                    }
+                    else
+                    {
+                        load(in.buf, code[in.childIndex].buf);
+                        for (int j = 1; j < in.narg; ++j)
+                        {
+                            div(in.buf, code[in.childIndex + j].buf);
+                        }
+                    }
+                    break;
+                }
+            case OpCodes::Sin:
+                {
+                    sin(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Cos:
+                {
+                    cos(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Tan:
+                {
+                    tan(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Log:
+                {
+                    log(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Exp:
+                {
+                    exp(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Power:
+                {
+                    load(in.buf, code[in.childIndex].buf);
+                    pow(in.buf, code[in.childIndex + 1].buf);
+                    break;
+                }
+            case OpCodes::Root:
+                {
+                    load(in.buf, code[in.childIndex].buf);
+                    root(in.buf, code[in.childIndex + 1].buf);
+                    break;
+                }
+            case OpCodes::Square:
+                {
+                    square(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+            case OpCodes::Sqrt:
+                {
+                    sqrt(in.buf, code[in.childIndex].buf);
+                    break;
+                }
+        }
+    }
+}
+
+#endif
Index: stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h
===================================================================
--- stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h	(revision 17071)
+++ stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h	(revision 17071)
@@ -0,0 +1,75 @@
+#ifndef VECTOR_OPERATIONS_H
+#define VECTOR_OPERATIONS_H
+
+#define _USE_MATH_DEFINES
+#include <cmath>
+#include <cstring>
+
+#ifdef USE_VDT
+#include "vdt/vdtMath.h"
+#include "vdt/stdwrap.h"
+#define hl_exp vdt::fast_exp
+#define hl_log vdt::fast_log
+#define hl_sin vdt::fast_sin
+#define hl_cos vdt::fast_cos
+#define hl_tan vdt::fast_tan
+#define hl_sqrt vdt::fast_sqrt
+#define hl_pow vdt::fast_pow
+#define hl_round vdt::fast_round
+#else
+#define hl_exp std::exp
+#define hl_log std::log
+#define hl_sin std::sin
+#define hl_cos std::cos
+#define hl_tan std::tan
+#define hl_sqrt std::sqrt
+#define hl_pow std::pow
+#define hl_round std::round
+#endif
+
+constexpr int BATCHSIZE = 64;
+
+#define FOR(i) for(int i = 0; i < BATCHSIZE; ++i)
+
+// When auto-vectorizing without __restrict,
+// gcc and clang check for overlap (with a bunch of integer code)
+// before running the vectorized loop
+
+// vector - vector operations
+inline void load(double* __restrict a, double const * __restrict b) noexcept { std::memcpy(a, b, BATCHSIZE * sizeof(double)); }
+inline void add(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] += b[i]; }
+inline void sub(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] -= b[i]; }
+inline void mul(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] *= b[i]; }
+inline void div(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] /= b[i]; }
+inline void exp(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_exp(b[i]); }
+inline void log(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_log(b[i]); }
+inline void sin(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_sin(b[i]); }
+inline void cos(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_cos(b[i]); }
+inline void tan(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_tan(b[i]); }
+inline void sqrt(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_sqrt(b[i]); }
+inline void pow(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], hl_round(b[i])); };
+inline void root(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], 1. / hl_round(b[i])); };
+inline void square(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(b[i], 2.); };
+inline void inv(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = 1. / b[i]; }
+inline void neg(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = -b[i]; }
+
+// vector - scalar operations
+inline void load(double* __restrict a, double s) noexcept { FOR(i) a[i] = s; }
+inline void add(double* __restrict a, double s) noexcept { FOR(i) a[i] += s; }
+inline void sub(double* __restrict a, double s) noexcept { FOR(i) a[i] -= s; }
+inline void mul(double* __restrict a, double s) noexcept { FOR(i) a[i] *= s; }
+inline void div(double* __restrict a, double s) noexcept { FOR(i) a[i] /= s; }
+
+// vector operations
+inline void neg(double* __restrict a) noexcept { FOR(i) a[i] = -a[i]; }
+inline void inv(double* __restrict a) noexcept { FOR(i) a[i] = 1. / a[i]; }
+inline void exp(double* __restrict a) noexcept { FOR(i) a[i] = hl_exp(a[i]); }
+inline void log(double* __restrict a) noexcept { FOR(i) a[i] = hl_log(a[i]); }
+inline void sin(double* __restrict a) noexcept { FOR(i) a[i] = hl_sin(a[i]); }
+inline void cos(double* __restrict a) noexcept { FOR(i) a[i] = hl_cos(a[i]); }
+inline void sqrt(double* __restrict a) noexcept { FOR(i) a[i] = hl_sqrt(a[i]); }
+inline void round(double* __restrict a) noexcept { FOR(i) a[i] = hl_round(a[i]); }
+inline void square(double* __restrict a) noexcept { FOR(i) a[i] = hl_pow(a[i], 2.); }
+
+#undef FOR
+#endif
