Index: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/HeuristicLab.NativeInterpreter-0.1/DllImporter.cs	(revision 16274)
@@ -43,4 +43,5 @@
     }
 
+    // x86
     [DllImport(x86dll, EntryPoint = "GetValue", CallingConvention = CallingConvention.Cdecl)]
     internal static extern double GetValue32(NativeInstruction[] code, int len, int row);
@@ -52,4 +53,5 @@
     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);
Index: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/CMakeLists.txt	(revision 16274)
@@ -19,7 +19,10 @@
     target_compile_options(hl-native-interpreter PRIVATE "/W4" "/Qvec-report:2" "$<$<CONFIG:Release>:/O2>")
     target_compile_options(hl-native-interpreter-vdt PRIVATE "/W4" "/Qvec-report:2" "$<$<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>:-Ofast>")
-    target_compile_options(hl-native-interpreter-vdt PRIVATE "-Wall" "-Wextra" "-Werror" "-fopt-info-vec-optimized" "$<$<CONFIG:Release>:-Ofast>")
+    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: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md	(revision 16274)
@@ -43,14 +43,24 @@
 ## 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                         |
+|  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: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/lib/vdt/exp.h	(revision 16274)
@@ -153,9 +153,4 @@
 //------------------------------------------------------------------------------
 
-void expv(const uint32_t size, double const * __restrict iarray, double* __restrict oarray);
-void fast_expv(const uint32_t size, double const * __restrict iarray, double* __restrict oarray);
-void expfv(const uint32_t size, float const * __restrict iarray, float* __restrict oarray);
-void fast_expfv(const uint32_t size, float const * __restrict iarray, float* __restrict oarray);
-
 } // end namespace vdt
 
Index: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.cpp	(revision 16274)
@@ -1,7 +1,9 @@
-#include <memory>
-
 #include "interpreter.h" 
 
+#ifdef __cplusplus
 extern "C" {
+#endif
+
+constexpr size_t BUFSIZE = BATCHSIZE * sizeof(double);
 
 // slow (ish?)
@@ -22,12 +24,11 @@
 
 __declspec(dllexport)
-void __cdecl GetValuesVectorized(instruction* code, int codeLength, int* rows, int totalRows, double* result) noexcept
+void __cdecl GetValuesVectorized(instruction* code, int codeLength, int* rows, int totalRows, double* __restrict result) noexcept
 {
-    std::vector<double[BUFSIZE]> buffers(codeLength);
-    // initialize instruction buffers
+    double* buffer = static_cast<double*>(_aligned_malloc(codeLength * BUFSIZE, 16));
     for (int i = 0; i < codeLength; ++i)
     {
         instruction& in = code[i];
-        in.buf = buffers[i];
+        in.buf = buffer + (i * BATCHSIZE);
 
         if (in.opcode == OpCodes::Const)
@@ -37,15 +38,16 @@
     }
 
-    int remainingRows = totalRows % BUFSIZE;
+    int remainingRows = totalRows % BATCHSIZE;
     int total = totalRows - remainingRows;
 
-    for (int rowIndex = 0; rowIndex < total; rowIndex += BUFSIZE)
+    for (int rowIndex = 0; rowIndex < total; rowIndex += BATCHSIZE)
     {
-        evaluate(code, codeLength, rows, rowIndex, BUFSIZE);
-        std::memcpy(result + rowIndex, code[0].buf, BUFSIZE * sizeof(double));
+        evaluate(code, codeLength, rows, rowIndex, BATCHSIZE);
+        std::memcpy(result + rowIndex, code[0].buf, BUFSIZE);
     }
 
     // are there any rows left?
-    if (remainingRows > 0) {
+    if (remainingRows > 0) 
+    {
         for (int rowIndex = total; rowIndex < totalRows; rowIndex += remainingRows)
         {
@@ -54,4 +56,5 @@
         }
     }
+    _aligned_free(buffer);
 }
 
Index: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h	(revision 16274)
@@ -2,10 +2,6 @@
 #define NATIVE_TREE_INTERPRETER_CLANG_H
 
-#include <cstring>
-#include <vector>
-#include <algorithm>
-
+#include "vector_operations.h"
 #include "instruction.h"
-#include "vector_operations.h"
 
 inline double evaluate(instruction *code, int len, int row) noexcept
@@ -146,12 +142,16 @@
             case OpCodes::Sub:
                 {
-                    load(in.buf, code[in.childIndex].buf);
-                    for (int j = 1; j < in.narg; ++j)
-                    {
-                        sub(in.buf, code[in.childIndex + j].buf);
-                    }
-                    if (in.narg == 1)
-                    {
-                        neg(in.buf);
+                    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;
@@ -168,12 +168,16 @@
             case OpCodes::Div:
                 {
-                    load(in.buf, code[in.childIndex].buf);
-                    for (int j = 1; j < in.narg; ++j)
-                    {
-                        div(in.buf, code[in.childIndex + j].buf);
-                    }
-                    if (in.narg == 1)
-                    {
-                        inv(in.buf);
+                    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;
Index: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h
===================================================================
--- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h	(revision 16269)
+++ trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h	(revision 16274)
@@ -2,6 +2,7 @@
 #define VECTOR_OPERATIONS_H
 
+#define _USE_MATH_DEFINES
+#include <cmath>
 #include <cstring>
-#include <cmath>
 
 #ifdef USE_VDT
@@ -27,7 +28,7 @@
 #endif
 
-constexpr int BUFSIZE = 64;
+constexpr int BATCHSIZE = 64;
 
-#define FOR(i) for(int i = 0; i < BUFSIZE; ++i)
+#define FOR(i) for(int i = 0; i < BATCHSIZE; ++i)
 
 // When auto-vectorizing without __restrict,
@@ -36,18 +37,20 @@
 
 // vector - vector operations
-inline void load(double* __restrict a, double* __restrict b) noexcept { std::memcpy(a, b, BUFSIZE * sizeof(double)); }
-inline void add(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] += b[i]; }
-inline void sub(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] -= b[i]; }
-inline void mul(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] *= b[i]; }
-inline void div(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] /= b[i]; }
-inline void exp(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_exp(b[i]); }
-inline void log(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_log(b[i]); }
-inline void sin(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_sin(b[i]); }
-inline void cos(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_cos(b[i]); }
-inline void tan(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_tan(b[i]); }
-inline void sqrt(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_sqrt(b[i]); }
-inline void pow(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], hl_round(b[i])); };
-inline void root(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], 1 / hl_round(b[i])); };
-inline void square(double* __restrict a, double* __restrict b) noexcept { FOR(i) a[i] = b[i] * b[i]; };
+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
@@ -60,5 +63,5 @@
 // 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 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]); }
@@ -67,5 +70,5 @@
 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] = a[i] * a[i];; }
+inline void square(double* __restrict a) noexcept { FOR(i) a[i] = hl_pow(a[i], 2.); }
 
 #undef FOR
