diff --git a/include/boost/math/differentiation/CMakeLists.txt b/include/boost/math/differentiation/CMakeLists.txt
new file mode 100644
index 000000000..0a83e2ba5
--- /dev/null
+++ b/include/boost/math/differentiation/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.5)
+set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
+set(THIS autodiff_reverse)
+
+project(autodiff_reverse C CXX)
+set(CMAKE_CXX_STANDARD 14)
+
+enable_testing()
+
+set(BOOST_ROOT_DIRECTORY /home/mzhelyez/Documents/code/boost/)
+set(BOOST_MATH_DIRECTORY ${BOOST_ROOT_DIRECTORY}/libs/math/)
+set(BOOST_MATH_TEST_DIRECTORY ${BOOST_MATH_DIRECTORY}test/)
+
+include_directories(${BOOST_MATH_DIRECTORY}include)
+
+
+set(HEADERS
+ ${CMAKE_SOURCE_DIR}/autodiff_reverse.hpp
+ ${BOOST_MATH_TEST_DIRECTORY}test_autodiff_reverse.hpp
+)
+
+set(SOURCES
+ ${BOOST_MATH_TEST_DIRECTORY}test_autodiff_reverse_flat_linear_allocator.cpp
+)
+add_executable(autodiff_reverse_tests ${SOURCES} ${HEADERS})
+
diff --git a/include/boost/math/differentiation/CMakeLists.txt.user b/include/boost/math/differentiation/CMakeLists.txt.user
new file mode 100644
index 000000000..0be52a70a
--- /dev/null
+++ b/include/boost/math/differentiation/CMakeLists.txt.user
@@ -0,0 +1,202 @@
+
+
+
+
+
+ EnvironmentId
+ {e6619c4f-7f68-4110-89de-37923deeee14}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ 0
+ false
+ true
+ false
+ 2
+ true
+ true
+ 0
+ 8
+ true
+ false
+ 1
+ true
+ true
+ true
+ *.md, *.MD, Makefile
+ false
+ true
+ true
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ true
+ false
+ true
+ true
+ true
+ true
+
+
+ 0
+ true
+
+ true
+ true
+ Builtin.DefaultTidyAndClazy
+ 10
+ true
+
+
+
+ true
+
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop
+ Imported Kit
+ Imported Kit
+ {d52c5e1b-ba1c-4a3d-8439-44355cfcc9f6}
+ 0
+ 0
+ 0
+
+ Debug
+ 2
+ false
+
+ -DCMAKE_GENERATOR:STRING=Unix Makefiles
+-DCMAKE_BUILD_TYPE:STRING=Build
+-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
+-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
+-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
+-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
+-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
+ /home/mzhelyez/Documents/code/boost/libs/math/include/boost/math/differentiation
+ /home/mzhelyez/Documents/code/boost/libs/math/include/boost/math/differentiation/build
+
+
+
+
+ all
+
+ false
+
+ true
+ Build
+ CMakeProjectManager.MakeStep
+
+ 1
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+
+
+ clean
+
+ false
+
+ true
+ Build
+ CMakeProjectManager.MakeStep
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Build
+ CMakeProjectManager.CMakeBuildConfiguration
+
+ 1
+
+
+ 0
+ Deploy
+ Deploy
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+
+ false
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+ true
+ true
+ 0
+ true
+
+ 2
+
+ false
+ -e cpu-cycles --call-graph dwarf,4096 -F 250
+ autodiff_reverse_tests
+ CMakeProjectManager.CMakeRunConfiguration.autodiff_reverse_tests
+ autodiff_reverse_tests
+ false
+ true
+ true
+ true
+ /home/mzhelyez/Documents/code/boost/libs/math/include/boost/math/differentiation/build
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 22
+
+
+ Version
+ 22
+
+
diff --git a/include/boost/math/differentiation/autodiff_reverse.hpp b/include/boost/math/differentiation/autodiff_reverse.hpp
new file mode 100644
index 000000000..b4f568670
--- /dev/null
+++ b/include/boost/math/differentiation/autodiff_reverse.hpp
@@ -0,0 +1,885 @@
+#ifndef BOOST_MATH_DIFFERENTIATION_AUTODIFF_HPP
+#define BOOST_MATH_DIFFERENTIATION_AUTODIFF_HPP
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include