diff --git a/ndnboost/math/special_functions/detail/fp_traits.hpp b/ndnboost/math/special_functions/detail/fp_traits.hpp
new file mode 100644
index 0000000..e1c8d78
--- /dev/null
+++ b/ndnboost/math/special_functions/detail/fp_traits.hpp
@@ -0,0 +1,570 @@
+// fp_traits.hpp
+
+#ifndef BOOST_MATH_FP_TRAITS_HPP
+#define BOOST_MATH_FP_TRAITS_HPP
+
+// Copyright (c) 2006 Johan Rade
+
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+/*
+To support old compilers, care has been taken to avoid partial template
+specialization and meta function forwarding.
+With these techniques, the code could be simplified.
+*/
+
+#if defined(__vms) && defined(__DECCXX) && !__IEEE_FLOAT
+// The VAX floating point formats are used (for float and double)
+#   define BOOST_FPCLASSIFY_VAX_FORMAT
+#endif
+
+#include <cstring>
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/cstdint.hpp>
+#include <ndnboost/detail/endian.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type_traits/is_floating_point.hpp>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+  namespace std{ using ::memcpy; }
+#endif
+
+#ifndef FP_NORMAL
+
+#define FP_ZERO        0
+#define FP_NORMAL      1
+#define FP_INFINITE    2
+#define FP_NAN         3
+#define FP_SUBNORMAL   4
+
+#else
+
+#define BOOST_HAS_FPCLASSIFY
+
+#ifndef fpclassify
+#  if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
+         && defined(_GLIBCXX_USE_C99_MATH) \
+         && !(defined(_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) \
+         && (_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC != 0))
+#     ifdef _STLP_VENDOR_CSTD
+#        if _STLPORT_VERSION >= 0x520
+#           define BOOST_FPCLASSIFY_PREFIX ::__std_alias:: 
+#        else
+#           define BOOST_FPCLASSIFY_PREFIX ::_STLP_VENDOR_CSTD:: 
+#        endif
+#     else
+#        define BOOST_FPCLASSIFY_PREFIX ::std::
+#     endif
+#  else
+#     undef BOOST_HAS_FPCLASSIFY
+#     define BOOST_FPCLASSIFY_PREFIX
+#  endif
+#elif (defined(__HP_aCC) && !defined(__hppa))
+// aCC 6 appears to do "#define fpclassify fpclassify" which messes us up a bit!
+#  define BOOST_FPCLASSIFY_PREFIX ::
+#else
+#  define BOOST_FPCLASSIFY_PREFIX
+#endif
+
+#ifdef __MINGW32__
+#  undef BOOST_HAS_FPCLASSIFY
+#endif
+
+#endif
+
+
+//------------------------------------------------------------------------------
+
+namespace ndnboost {
+namespace math {
+namespace detail {
+
+//------------------------------------------------------------------------------
+
+/* 
+The following classes are used to tag the different methods that are used
+for floating point classification
+*/
+
+struct native_tag {};
+template <bool has_limits>
+struct generic_tag {};
+struct ieee_tag {};
+struct ieee_copy_all_bits_tag : public ieee_tag {};
+struct ieee_copy_leading_bits_tag : public ieee_tag {};
+
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+//
+// These helper functions are used only when numeric_limits<>
+// members are not compile time constants:
+//
+inline bool is_generic_tag_false(const generic_tag<false>*)
+{
+   return true;
+}
+inline bool is_generic_tag_false(const void*)
+{
+   return false;
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+/*
+Most processors support three different floating point precisions:
+single precision (32 bits), double precision (64 bits)
+and extended double precision (80 - 128 bits, depending on the processor)
+
+Note that the C++ type long double can be implemented
+both as double precision and extended double precision.
+*/
+
+struct unknown_precision{};
+struct single_precision {};
+struct double_precision {};
+struct extended_double_precision {};
+
+// native_tag version --------------------------------------------------------------
+
+template<class T> struct fp_traits_native
+{
+    typedef native_tag method;
+};
+
+// generic_tag version -------------------------------------------------------------
+
+template<class T, class U> struct fp_traits_non_native
+{
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   typedef generic_tag<std::numeric_limits<T>::is_specialized> method;
+#else
+   typedef generic_tag<false> method;
+#endif
+};
+
+// ieee_tag versions ---------------------------------------------------------------
+
+/*
+These specializations of fp_traits_non_native contain information needed
+to "parse" the binary representation of a floating point number.
+
+Typedef members:
+
+  bits -- the target type when copying the leading bytes of a floating
+      point number. It is a typedef for uint32_t or uint64_t.
+
+  method -- tells us whether all bytes are copied or not.
+      It is a typedef for ieee_copy_all_bits_tag or ieee_copy_leading_bits_tag.
+
+Static data members:
+
+  sign, exponent, flag, significand -- bit masks that give the meaning of the
+  bits in the leading bytes.
+
+Static function members:
+
+  get_bits(), set_bits() -- provide access to the leading bytes.
+
+*/
+
+// ieee_tag version, float (32 bits) -----------------------------------------------
+
+#ifndef BOOST_FPCLASSIFY_VAX_FORMAT
+
+template<> struct fp_traits_non_native<float, single_precision>
+{
+    typedef ieee_copy_all_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7f800000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0x00000000);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x007fffff);
+
+    typedef uint32_t bits;
+    static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); }
+    static void set_bits(float& x, uint32_t a) { std::memcpy(&x, &a, 4); }
+};
+
+// ieee_tag version, double (64 bits) ----------------------------------------------
+
+#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) \
+   || defined(__BORLANDC__) || defined(__CODEGEAR__)
+
+template<> struct fp_traits_non_native<double, double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7ff00000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+    typedef uint32_t bits;
+
+    static void get_bits(double x, uint32_t& a)
+    {
+        std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+    }
+
+    static void set_bits(double& x, uint32_t a)
+    {
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+    }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 4);
+#else
+    BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+//..............................................................................
+
+#else
+
+template<> struct fp_traits_non_native<double, double_precision>
+{
+    typedef ieee_copy_all_bits_tag method;
+
+    static const uint64_t sign     = ((uint64_t)0x80000000u) << 32;
+    static const uint64_t exponent = ((uint64_t)0x7ff00000) << 32;
+    static const uint64_t flag     = 0;
+    static const uint64_t significand
+        = (((uint64_t)0x000fffff) << 32) + ((uint64_t)0xffffffffu);
+
+    typedef uint64_t bits;
+    static void get_bits(double x, uint64_t& a) { std::memcpy(&a, &x, 8); }
+    static void set_bits(double& x, uint64_t a) { std::memcpy(&x, &a, 8); }
+};
+
+#endif
+
+#endif  // #ifndef BOOST_FPCLASSIFY_VAX_FORMAT
+
+// long double (64 bits) -------------------------------------------------------
+
+#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)\
+   || defined(__BORLANDC__) || defined(__CODEGEAR__)
+
+template<> struct fp_traits_non_native<long double, double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7ff00000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+    typedef uint32_t bits;
+
+    static void get_bits(long double x, uint32_t& a)
+    {
+        std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+    }
+
+    static void set_bits(long double& x, uint32_t a)
+    {
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+    }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 4);
+#else
+    BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+//..............................................................................
+
+#else
+
+template<> struct fp_traits_non_native<long double, double_precision>
+{
+    typedef ieee_copy_all_bits_tag method;
+
+    static const uint64_t sign     = (uint64_t)0x80000000u << 32;
+    static const uint64_t exponent = (uint64_t)0x7ff00000 << 32;
+    static const uint64_t flag     = 0;
+    static const uint64_t significand
+        = ((uint64_t)0x000fffff << 32) + (uint64_t)0xffffffffu;
+
+    typedef uint64_t bits;
+    static void get_bits(long double x, uint64_t& a) { std::memcpy(&a, &x, 8); }
+    static void set_bits(long double& x, uint64_t a) { std::memcpy(&x, &a, 8); }
+};
+
+#endif
+
+
+// long double (>64 bits), x86 and x64 -----------------------------------------
+
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
+    || defined(__amd64) || defined(__amd64__)  || defined(_M_AMD64) \
+    || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
+
+// Intel extended double precision format (80 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7fff0000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0x00008000);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
+
+    typedef uint32_t bits;
+
+    static void get_bits(long double x, uint32_t& a)
+    {
+        std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + 6, 4);
+    }
+
+    static void set_bits(long double& x, uint32_t a)
+    {
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + 6, &a, 4);
+    }
+};
+
+
+// long double (>64 bits), Itanium ---------------------------------------------
+
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+
+// The floating point format is unknown at compile time
+// No template specialization is provided.
+// The generic_tag definition is used.
+
+// The Itanium supports both
+// the Intel extended double precision format (80 bits) and
+// the IEEE extended double precision format with 15 exponent bits (128 bits).
+
+
+// long double (>64 bits), PowerPC ---------------------------------------------
+
+#elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) \
+    || defined(__ppc) || defined(__ppc__) || defined(__PPC__)
+
+// PowerPC extended double precision format (128 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7ff00000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0x00000000);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+    typedef uint32_t bits;
+
+    static void get_bits(long double x, uint32_t& a)
+    {
+        std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+    }
+
+    static void set_bits(long double& x, uint32_t a)
+    {
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+    }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 12);
+#else
+    BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+
+// long double (>64 bits), Motorola 68K ----------------------------------------
+
+#elif defined(__m68k) || defined(__m68k__) \
+    || defined(__mc68000) || defined(__mc68000__) \
+
+// Motorola extended double precision format (96 bits)
+
+// It is the same format as the Intel extended double precision format,
+// except that 1) it is big-endian, 2) the 3rd and 4th byte are padding, and
+// 3) the flag bit is not set for infinity
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7fff0000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0x00008000);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
+
+    // copy 1st, 2nd, 5th and 6th byte. 3rd and 4th byte are padding.
+
+    typedef uint32_t bits;
+
+    static void get_bits(long double x, uint32_t& a)
+    {
+        std::memcpy(&a, &x, 2);
+        std::memcpy(reinterpret_cast<unsigned char*>(&a) + 2,
+               reinterpret_cast<const unsigned char*>(&x) + 4, 2);
+    }
+
+    static void set_bits(long double& x, uint32_t a)
+    {
+        std::memcpy(&x, &a, 2);
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + 4,
+               reinterpret_cast<const unsigned char*>(&a) + 2, 2);
+    }
+};
+
+
+// long double (>64 bits), All other processors --------------------------------
+
+#else
+
+// IEEE extended double precision format with 15 exponent bits (128 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+    typedef ieee_copy_leading_bits_tag method;
+
+    BOOST_STATIC_CONSTANT(uint32_t, sign        = 0x80000000u);
+    BOOST_STATIC_CONSTANT(uint32_t, exponent    = 0x7fff0000);
+    BOOST_STATIC_CONSTANT(uint32_t, flag        = 0x00000000);
+    BOOST_STATIC_CONSTANT(uint32_t, significand = 0x0000ffff);
+
+    typedef uint32_t bits;
+
+    static void get_bits(long double x, uint32_t& a)
+    {
+        std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+    }
+
+    static void set_bits(long double& x, uint32_t a)
+    {
+        std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+    }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+    BOOST_STATIC_CONSTANT(int, offset_ = 12);
+#else
+    BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+#endif
+
+//------------------------------------------------------------------------------
+
+// size_to_precision is a type switch for converting a C++ floating point type
+// to the corresponding precision type.
+
+template<int n, bool fp> struct size_to_precision
+{
+   typedef unknown_precision type;
+};
+
+template<> struct size_to_precision<4, true>
+{
+    typedef single_precision type;
+};
+
+template<> struct size_to_precision<8, true>
+{
+    typedef double_precision type;
+};
+
+template<> struct size_to_precision<10, true>
+{
+    typedef extended_double_precision type;
+};
+
+template<> struct size_to_precision<12, true>
+{
+    typedef extended_double_precision type;
+};
+
+template<> struct size_to_precision<16, true>
+{
+    typedef extended_double_precision type;
+};
+
+//------------------------------------------------------------------------------
+//
+// Figure out whether to use native classification functions based on
+// whether T is a built in floating point type or not:
+//
+template <class T>
+struct select_native
+{
+    typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::ndnboost::is_floating_point<T>::value>::type precision;
+    typedef fp_traits_non_native<T, precision> type;
+};
+template<>
+struct select_native<float>
+{
+    typedef fp_traits_native<float> type;
+};
+template<>
+struct select_native<double>
+{
+    typedef fp_traits_native<double> type;
+};
+template<>
+struct select_native<long double>
+{
+    typedef fp_traits_native<long double> type;
+};
+
+//------------------------------------------------------------------------------
+
+// fp_traits is a type switch that selects the right fp_traits_non_native
+
+#if (defined(BOOST_MATH_USE_C99) && !(defined(__GNUC__) && (__GNUC__ < 4))) \
+   && !defined(__hpux) \
+   && !defined(__DECCXX)\
+   && !defined(__osf__) \
+   && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\
+   && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+#  define BOOST_MATH_USE_STD_FPCLASSIFY
+#endif
+
+template<class T> struct fp_traits
+{
+    typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::ndnboost::is_floating_point<T>::value>::type precision;
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+    typedef typename select_native<T>::type type;
+#else
+    typedef fp_traits_non_native<T, precision> type;
+#endif
+    typedef fp_traits_non_native<T, precision> sign_change_type;
+};
+
+//------------------------------------------------------------------------------
+
+}   // namespace detail
+}   // namespace math
+}   // namespace ndnboost
+
+#endif
diff --git a/ndnboost/math/special_functions/detail/round_fwd.hpp b/ndnboost/math/special_functions/detail/round_fwd.hpp
new file mode 100644
index 0000000..62d9390
--- /dev/null
+++ b/ndnboost/math/special_functions/detail/round_fwd.hpp
@@ -0,0 +1,93 @@
+// Copyright John Maddock 2008.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_SPECIAL_ROUND_FWD_HPP
+#define BOOST_MATH_SPECIAL_ROUND_FWD_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/math/tools/promotion.hpp>
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+namespace ndnboost
+{
+   namespace math
+   { 
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
+   template <class T>
+   typename tools::promote_args<T>::type trunc(const T& v);
+   template <class T, class Policy>
+   int itrunc(const T& v, const Policy& pol);
+   template <class T>
+   int itrunc(const T& v);
+   template <class T, class Policy>
+   long ltrunc(const T& v, const Policy& pol);
+   template <class T>
+   long ltrunc(const T& v);
+#ifdef BOOST_HAS_LONG_LONG
+   template <class T, class Policy>
+   ndnboost::long_long_type lltrunc(const T& v, const Policy& pol);
+   template <class T>
+   ndnboost::long_long_type lltrunc(const T& v);
+#endif
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
+   template <class T>
+   typename tools::promote_args<T>::type round(const T& v);
+   template <class T, class Policy>
+   int iround(const T& v, const Policy& pol);
+   template <class T>
+   int iround(const T& v);
+   template <class T, class Policy>
+   long lround(const T& v, const Policy& pol);
+   template <class T>
+   long lround(const T& v);
+#ifdef BOOST_HAS_LONG_LONG
+   template <class T, class Policy>
+   ndnboost::long_long_type llround(const T& v, const Policy& pol);
+   template <class T>
+   ndnboost::long_long_type llround(const T& v);
+#endif
+   template <class T, class Policy>
+   T modf(const T& v, T* ipart, const Policy& pol);
+   template <class T>
+   T modf(const T& v, T* ipart);
+   template <class T, class Policy>
+   T modf(const T& v, int* ipart, const Policy& pol);
+   template <class T>
+   T modf(const T& v, int* ipart);
+   template <class T, class Policy>
+   T modf(const T& v, long* ipart, const Policy& pol);
+   template <class T>
+   T modf(const T& v, long* ipart);
+#ifdef BOOST_HAS_LONG_LONG
+   template <class T, class Policy>
+   T modf(const T& v, ndnboost::long_long_type* ipart, const Policy& pol);
+   template <class T>
+   T modf(const T& v, ndnboost::long_long_type* ipart);
+#endif
+
+   }
+}
+
+#undef BOOST_MATH_STD_USING
+#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE\
+   using ndnboost::math::round;\
+   using ndnboost::math::iround;\
+   using ndnboost::math::lround;\
+   using ndnboost::math::trunc;\
+   using ndnboost::math::itrunc;\
+   using ndnboost::math::ltrunc;\
+   using ndnboost::math::modf;
+
+
+#endif // BOOST_MATH_SPECIAL_ROUND_FWD_HPP
+
diff --git a/ndnboost/math/special_functions/fpclassify.hpp b/ndnboost/math/special_functions/fpclassify.hpp
new file mode 100644
index 0000000..0eeea57
--- /dev/null
+++ b/ndnboost/math/special_functions/fpclassify.hpp
@@ -0,0 +1,606 @@
+//  Copyright John Maddock 2005-2008.
+//  Copyright (c) 2006-2008 Johan Rade
+//  Use, modification and distribution are subject to the
+//  Boost Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_FPCLASSIFY_HPP
+#define BOOST_MATH_FPCLASSIFY_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <math.h>
+#include <ndnboost/config/no_tr1/cmath.hpp>
+#include <ndnboost/limits.hpp>
+#include <ndnboost/math/tools/real_cast.hpp>
+#include <ndnboost/type_traits/is_floating_point.hpp>
+#include <ndnboost/math/special_functions/math_fwd.hpp>
+#include <ndnboost/math/special_functions/detail/fp_traits.hpp>
+/*!
+  \file fpclassify.hpp
+  \brief Classify floating-point value as normal, subnormal, zero, infinite, or NaN.
+  \version 1.0
+  \author John Maddock
+ */
+
+/*
+
+1. If the platform is C99 compliant, then the native floating point
+classification functions are used.  However, note that we must only
+define the functions which call std::fpclassify etc if that function
+really does exist: otherwise a compiler may reject the code even though
+the template is never instantiated.
+
+2. If the platform is not C99 compliant, and the binary format for
+a floating point type (float, double or long double) can be determined
+at compile time, then the following algorithm is used:
+
+        If all exponent bits, the flag bit (if there is one),
+        and all significand bits are 0, then the number is zero.
+
+        If all exponent bits and the flag bit (if there is one) are 0,
+        and at least one significand bit is 1, then the number is subnormal.
+
+        If all exponent bits are 1 and all significand bits are 0,
+        then the number is infinity.
+
+        If all exponent bits are 1 and at least one significand bit is 1,
+        then the number is a not-a-number.
+
+        Otherwise the number is normal.
+
+        This algorithm works for the IEEE 754 representation,
+        and also for several non IEEE 754 formats.
+
+    Most formats have the structure
+        sign bit + exponent bits + significand bits.
+
+    A few have the structure
+        sign bit + exponent bits + flag bit + significand bits.
+    The flag bit is 0 for zero and subnormal numbers,
+        and 1 for normal numbers and NaN.
+        It is 0 (Motorola 68K) or 1 (Intel) for infinity.
+
+    To get the bits, the four or eight most significant bytes are copied
+    into an uint32_t or uint64_t and bit masks are applied.
+    This covers all the exponent bits and the flag bit (if there is one),
+    but not always all the significand bits.
+    Some of the functions below have two implementations,
+    depending on whether all the significand bits are copied or not.
+
+3. If the platform is not C99 compliant, and the binary format for
+a floating point type (float, double or long double) can not be determined
+at compile time, then comparison with std::numeric_limits values
+is used.
+
+*/
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#include <float.h>
+#endif
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+  namespace std{ using ::abs; using ::fabs; }
+#endif
+
+namespace ndnboost{
+
+//
+// This must not be located in any namespace under ndnboost::math
+// otherwise we can get into an infinite loop if isnan is
+// a #define for "isnan" !
+//
+namespace math_detail{
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4800)
+#endif
+
+template <class T>
+inline bool is_nan_helper(T t, const ndnboost::true_type&)
+{
+#ifdef isnan
+   return isnan(t);
+#elif defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) || !defined(BOOST_HAS_FPCLASSIFY)
+   (void)t;
+   return false;
+#else // BOOST_HAS_FPCLASSIFY
+   return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN);
+#endif
+}
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+template <class T>
+inline bool is_nan_helper(T, const ndnboost::false_type&)
+{
+   return false;
+}
+
+}
+
+namespace math{
+
+namespace detail{
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const native_tag&)
+{
+   return (std::fpclassify)(t);
+}
+#endif
+
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag<true>&)
+{
+   BOOST_MATH_INSTRUMENT_VARIABLE(t);
+
+   // whenever possible check for Nan's first:
+#if defined(BOOST_HAS_FPCLASSIFY)  && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+   if(::ndnboost::math_detail::is_nan_helper(t, ::ndnboost::is_floating_point<T>()))
+      return FP_NAN;
+#elif defined(isnan)
+   if(ndnboost::math_detail::is_nan_helper(t, ::ndnboost::is_floating_point<T>()))
+      return FP_NAN;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+   if(::_isnan(ndnboost::math::tools::real_cast<double>(t)))
+      return FP_NAN;
+#endif
+   // std::fabs broken on a few systems especially for long long!!!!
+   T at = (t < T(0)) ? -t : t;
+
+   // Use a process of exclusion to figure out
+   // what kind of type we have, this relies on
+   // IEEE conforming reals that will treat
+   // Nan's as unordered.  Some compilers
+   // don't do this once optimisations are
+   // turned on, hence the check for nan's above.
+   if(at <= (std::numeric_limits<T>::max)())
+   {
+      if(at >= (std::numeric_limits<T>::min)())
+         return FP_NORMAL;
+      return (at != 0) ? FP_SUBNORMAL : FP_ZERO;
+   }
+   else if(at > (std::numeric_limits<T>::max)())
+      return FP_INFINITE;
+   return FP_NAN;
+}
+
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag<false>&)
+{
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   if(std::numeric_limits<T>::is_specialized)
+      return fpclassify_imp(t, generic_tag<true>());
+#endif
+   //
+   // An unknown type with no numeric_limits support,
+   // so what are we supposed to do we do here?
+   //
+   BOOST_MATH_INSTRUMENT_VARIABLE(t);
+
+   return t == 0 ? FP_ZERO : FP_NORMAL;
+}
+
+template<class T>
+int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag)
+{
+   typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+   BOOST_MATH_INSTRUMENT_VARIABLE(x);
+
+   BOOST_DEDUCED_TYPENAME traits::bits a;
+   traits::get_bits(x,a);
+   BOOST_MATH_INSTRUMENT_VARIABLE(a);
+   a &= traits::exponent | traits::flag | traits::significand;
+   BOOST_MATH_INSTRUMENT_VARIABLE((traits::exponent | traits::flag | traits::significand));
+   BOOST_MATH_INSTRUMENT_VARIABLE(a);
+
+   if(a <= traits::significand) {
+      if(a == 0)
+         return FP_ZERO;
+      else
+         return FP_SUBNORMAL;
+   }
+
+   if(a < traits::exponent) return FP_NORMAL;
+
+   a &= traits::significand;
+   if(a == 0) return FP_INFINITE;
+
+   return FP_NAN;
+}
+
+template<class T>
+int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag)
+{
+   typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+   BOOST_MATH_INSTRUMENT_VARIABLE(x);
+
+   BOOST_DEDUCED_TYPENAME traits::bits a;
+   traits::get_bits(x,a);
+   a &= traits::exponent | traits::flag | traits::significand;
+
+   if(a <= traits::significand) {
+      if(x == 0)
+         return FP_ZERO;
+      else
+         return FP_SUBNORMAL;
+   }
+
+   if(a < traits::exponent) return FP_NORMAL;
+
+   a &= traits::significand;
+   traits::set_bits(x,a);
+   if(x == 0) return FP_INFINITE;
+
+   return FP_NAN;
+}
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && (defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS))
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+   return ndnboost::math::detail::fpclassify_imp(t, generic_tag<true>());
+}
+#endif
+
+}  // namespace detail
+
+template <class T>
+inline int fpclassify BOOST_NO_MACRO_EXPAND(T t)
+{
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   typedef typename tools::promote_args<T>::type value_type;
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   if(std::numeric_limits<T>::is_specialized && detail::is_generic_tag_false(static_cast<method*>(0)))
+      return detail::fpclassify_imp(static_cast<value_type>(t), detail::generic_tag<true>());
+   return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#else
+   return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#endif
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template <>
+inline int fpclassify<long double> BOOST_NO_MACRO_EXPAND(long double t)
+{
+   typedef detail::fp_traits<long double>::type traits;
+   typedef traits::method method;
+   typedef long double value_type;
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   if(std::numeric_limits<long double>::is_specialized && detail::is_generic_tag_false(static_cast<method*>(0)))
+      return detail::fpclassify_imp(static_cast<value_type>(t), detail::generic_tag<true>());
+   return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#else
+   return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#endif
+}
+#endif
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+    template<class T>
+    inline bool isfinite_impl(T x, native_tag const&)
+    {
+        return (std::isfinite)(x);
+    }
+#endif
+
+    template<class T>
+    inline bool isfinite_impl(T x, generic_tag<true> const&)
+    {
+        return x >= -(std::numeric_limits<T>::max)()
+            && x <= (std::numeric_limits<T>::max)();
+    }
+
+    template<class T>
+    inline bool isfinite_impl(T x, generic_tag<false> const&)
+    {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+      if(std::numeric_limits<T>::is_specialized)
+         return isfinite_impl(x, generic_tag<true>());
+#endif
+       (void)x; // warning supression.
+       return true;
+    }
+
+    template<class T>
+    inline bool isfinite_impl(T x, ieee_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a &= traits::exponent;
+        return a != traits::exponent;
+    }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isfinite_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+   return ndnboost::math::detail::isfinite_impl(t, generic_tag<true>());
+}
+#endif
+
+}
+
+template<class T>
+inline bool (isfinite)(T x)
+{ //!< \brief return true if floating-point type t is finite.
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   typedef typename tools::promote_args<T>::type value_type;
+   return detail::isfinite_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isfinite)(long double x)
+{ //!< \brief return true if floating-point type t is finite.
+   typedef detail::fp_traits<long double>::type traits;
+   typedef traits::method method;
+   typedef ndnboost::is_floating_point<long double>::type fp_tag;
+   typedef long double value_type;
+   return detail::isfinite_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+    template<class T>
+    inline bool isnormal_impl(T x, native_tag const&)
+    {
+        return (std::isnormal)(x);
+    }
+#endif
+
+    template<class T>
+    inline bool isnormal_impl(T x, generic_tag<true> const&)
+    {
+        if(x < 0) x = -x;
+        return x >= (std::numeric_limits<T>::min)()
+            && x <= (std::numeric_limits<T>::max)();
+    }
+
+    template<class T>
+    inline bool isnormal_impl(T x, generic_tag<false> const&)
+    {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+      if(std::numeric_limits<T>::is_specialized)
+         return isnormal_impl(x, generic_tag<true>());
+#endif
+       return !(x == 0);
+    }
+
+    template<class T>
+    inline bool isnormal_impl(T x, ieee_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a &= traits::exponent | traits::flag;
+        return (a != 0) && (a < traits::exponent);
+    }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isnormal_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+   return ndnboost::math::detail::isnormal_impl(t, generic_tag<true>());
+}
+#endif
+
+}
+
+template<class T>
+inline bool (isnormal)(T x)
+{
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   //typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   typedef typename tools::promote_args<T>::type value_type;
+   return detail::isnormal_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isnormal)(long double x)
+{
+   typedef detail::fp_traits<long double>::type traits;
+   typedef traits::method method;
+   typedef ndnboost::is_floating_point<long double>::type fp_tag;
+   typedef long double value_type;
+   return detail::isnormal_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+    template<class T>
+    inline bool isinf_impl(T x, native_tag const&)
+    {
+        return (std::isinf)(x);
+    }
+#endif
+
+    template<class T>
+    inline bool isinf_impl(T x, generic_tag<true> const&)
+    {
+        (void)x; // in case the compiler thinks that x is unused because std::numeric_limits<T>::has_infinity is false
+        return std::numeric_limits<T>::has_infinity
+            && ( x == std::numeric_limits<T>::infinity()
+                 || x == -std::numeric_limits<T>::infinity());
+    }
+
+    template<class T>
+    inline bool isinf_impl(T x, generic_tag<false> const&)
+    {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+      if(std::numeric_limits<T>::is_specialized)
+         return isinf_impl(x, generic_tag<true>());
+#endif
+        (void)x; // warning supression.
+        return false;
+    }
+
+    template<class T>
+    inline bool isinf_impl(T x, ieee_copy_all_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a &= traits::exponent | traits::significand;
+        return a == traits::exponent;
+    }
+
+    template<class T>
+    inline bool isinf_impl(T x, ieee_copy_leading_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a &= traits::exponent | traits::significand;
+        if(a != traits::exponent)
+            return false;
+
+        traits::set_bits(x,0);
+        return x == 0;
+    }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isinf_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+   return ndnboost::math::detail::isinf_impl(t, generic_tag<true>());
+}
+#endif
+
+}   // namespace detail
+
+template<class T>
+inline bool (isinf)(T x)
+{
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   typedef typename tools::promote_args<T>::type value_type;
+   return detail::isinf_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isinf)(long double x)
+{
+   typedef detail::fp_traits<long double>::type traits;
+   typedef traits::method method;
+   typedef ndnboost::is_floating_point<long double>::type fp_tag;
+   typedef long double value_type;
+   return detail::isinf_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+    template<class T>
+    inline bool isnan_impl(T x, native_tag const&)
+    {
+        return (std::isnan)(x);
+    }
+#endif
+
+    template<class T>
+    inline bool isnan_impl(T x, generic_tag<true> const&)
+    {
+        return std::numeric_limits<T>::has_infinity
+            ? !(x <= std::numeric_limits<T>::infinity())
+            : x != x;
+    }
+
+    template<class T>
+    inline bool isnan_impl(T x, generic_tag<false> const&)
+    {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+      if(std::numeric_limits<T>::is_specialized)
+         return isnan_impl(x, generic_tag<true>());
+#endif
+        (void)x; // warning supression
+        return false;
+    }
+
+    template<class T>
+    inline bool isnan_impl(T x, ieee_copy_all_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a &= traits::exponent | traits::significand;
+        return a > traits::exponent;
+    }
+
+    template<class T>
+    inline bool isnan_impl(T x, ieee_copy_leading_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+
+        a &= traits::exponent | traits::significand;
+        if(a < traits::exponent)
+            return false;
+
+        a &= traits::significand;
+        traits::set_bits(x,a);
+        return x != 0;
+    }
+
+}   // namespace detail
+
+template<class T>
+inline bool (isnan)(T x)
+{ //!< \brief return true if floating-point type t is NaN (Not A Number).
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   return detail::isnan_impl(x, method());
+}
+
+#ifdef isnan
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<float>(float t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<double>(double t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<long double>(long double t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+#elif defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+template<>
+inline bool (isnan)(long double x)
+{ //!< \brief return true if floating-point type t is NaN (Not A Number).
+   typedef detail::fp_traits<long double>::type traits;
+   typedef traits::method method;
+   typedef ndnboost::is_floating_point<long double>::type fp_tag;
+   return detail::isnan_impl(x, method());
+}
+#endif
+
+} // namespace math
+} // namespace ndnboost
+
+#endif // BOOST_MATH_FPCLASSIFY_HPP
+
diff --git a/ndnboost/math/special_functions/math_fwd.hpp b/ndnboost/math/special_functions/math_fwd.hpp
new file mode 100644
index 0000000..aeb7b4c
--- /dev/null
+++ b/ndnboost/math/special_functions/math_fwd.hpp
@@ -0,0 +1,1408 @@
+// math_fwd.hpp
+
+// TODO revise completely for new distribution classes.
+
+// Copyright Paul A. Bristow 2006.
+// Copyright John Maddock 2006.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// Omnibus list of forward declarations of math special functions.
+
+// IT = Integer type.
+// RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types
+// AT = Integer or Real type
+
+#ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP
+#define BOOST_MATH_SPECIAL_MATH_FWD_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <ndnboost/math/special_functions/detail/round_fwd.hpp>
+#include <ndnboost/math/tools/promotion.hpp> // for argument promotion.
+#include <ndnboost/math/policies/policy.hpp>
+#include <ndnboost/mpl/comparison.hpp>
+#include <ndnboost/config/no_tr1/complex.hpp>
+
+#define BOOST_NO_MACRO_EXPAND /**/
+
+namespace ndnboost
+{
+   namespace math
+   { // Math functions (in roughly alphabetic order).
+
+   // Beta functions.
+   template <class RT1, class RT2>
+   typename tools::promote_args<RT1, RT2>::type
+         beta(RT1 a, RT2 b); // Beta function (2 arguments).
+
+   template <class RT1, class RT2, class A>
+   typename tools::promote_args<RT1, RT2, A>::type
+         beta(RT1 a, RT2 b, A x); // Beta function (3 arguments).
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments).
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         betac(RT1 a, RT2 b, RT3 x);
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         betac(RT1 a, RT2 b, RT3 x, const Policy& pol);
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function.
+
+   template <class T1, class T2, class T3, class T4>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ibeta_inv(T1 a, T2 b, T3 p, T4* py);
+
+   template <class T1, class T2, class T3, class T4, class Policy>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol);
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+   template <class T1, class T2, class T3, class T4>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ibetac_inv(T1 a, T2 b, T3 q, T4* py);
+
+   template <class T1, class T2, class T3, class T4, class Policy>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol);
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+   template <class RT1, class RT2, class RT3>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_derivative(RT1 a, RT2 b, RT3 x);  // derivative of incomplete beta
+
+   template <class RT1, class RT2, class RT3, class Policy>
+   typename tools::promote_args<RT1, RT2, RT3>::type
+         ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol);  // derivative of incomplete beta
+
+   // erf & erfc error functions.
+   template <class RT> // Error function.
+   typename tools::promote_args<RT>::type erf(RT z);
+   template <class RT, class Policy> // Error function.
+   typename tools::promote_args<RT>::type erf(RT z, const Policy&);
+
+   template <class RT>// Error function complement.
+   typename tools::promote_args<RT>::type erfc(RT z);
+   template <class RT, class Policy>// Error function complement.
+   typename tools::promote_args<RT>::type erfc(RT z, const Policy&);
+
+   template <class RT>// Error function inverse.
+   typename tools::promote_args<RT>::type erf_inv(RT z);
+   template <class RT, class Policy>// Error function inverse.
+   typename tools::promote_args<RT>::type erf_inv(RT z, const Policy& pol);
+
+   template <class RT>// Error function complement inverse.
+   typename tools::promote_args<RT>::type erfc_inv(RT z);
+   template <class RT, class Policy>// Error function complement inverse.
+   typename tools::promote_args<RT>::type erfc_inv(RT z, const Policy& pol);
+
+   // Polynomials:
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+         legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1);
+
+   template <class T>
+   typename tools::promote_args<T>::type
+         legendre_p(int l, T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type
+         legendre_p(int l, T x, const Policy& pol);
+
+   template <class T>
+   typename tools::promote_args<T>::type
+         legendre_q(unsigned l, T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type
+         legendre_q(unsigned l, T x, const Policy& pol);
+
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+         legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
+
+   template <class T>
+   typename tools::promote_args<T>::type
+         legendre_p(int l, int m, T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type
+         legendre_p(int l, int m, T x, const Policy& pol);
+
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+         laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1);
+
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+      laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1);
+
+   template <class T>
+   typename tools::promote_args<T>::type
+      laguerre(unsigned n, T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type
+      laguerre(unsigned n, unsigned m, T x, const Policy& pol);
+
+   template <class T1, class T2>
+   struct laguerre_result
+   {
+      typedef typename mpl::if_<
+         policies::is_policy<T2>,
+         typename tools::promote_args<T1>::type,
+         typename tools::promote_args<T2>::type
+      >::type type;
+   };
+
+   template <class T1, class T2>
+   typename laguerre_result<T1, T2>::type
+      laguerre(unsigned n, T1 m, T2 x);
+
+   template <class T>
+   typename tools::promote_args<T>::type
+      hermite(unsigned n, T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type
+      hermite(unsigned n, T x, const Policy& pol);
+
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+      hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
+
+   template <class T1, class T2>
+   std::complex<typename tools::promote_args<T1, T2>::type>
+         spherical_harmonic(unsigned n, int m, T1 theta, T2 phi);
+
+   template <class T1, class T2, class Policy>
+   std::complex<typename tools::promote_args<T1, T2>::type>
+      spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type
+         spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type
+      spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type
+         spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type
+      spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+   // Elliptic integrals:
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+         ellint_rf(T1 x, T2 y, T3 z);
+
+   template <class T1, class T2, class T3, class Policy>
+   typename tools::promote_args<T1, T2, T3>::type
+         ellint_rf(T1 x, T2 y, T3 z, const Policy& pol);
+
+   template <class T1, class T2, class T3>
+   typename tools::promote_args<T1, T2, T3>::type
+         ellint_rd(T1 x, T2 y, T3 z);
+
+   template <class T1, class T2, class T3, class Policy>
+   typename tools::promote_args<T1, T2, T3>::type
+         ellint_rd(T1 x, T2 y, T3 z, const Policy& pol);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type
+         ellint_rc(T1 x, T2 y);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type
+         ellint_rc(T1 x, T2 y, const Policy& pol);
+
+   template <class T1, class T2, class T3, class T4>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ellint_rj(T1 x, T2 y, T3 z, T4 p);
+
+   template <class T1, class T2, class T3, class T4, class Policy>
+   typename tools::promote_args<T1, T2, T3, T4>::type
+         ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol);
+
+   template <typename T>
+   typename tools::promote_args<T>::type ellint_2(T k);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi, const Policy& pol);
+
+   template <typename T>
+   typename tools::promote_args<T>::type ellint_1(T k);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy& pol);
+
+   namespace detail{
+
+   template <class T, class U, class V>
+   struct ellint_3_result
+   {
+      typedef typename mpl::if_<
+         policies::is_policy<V>,
+         typename tools::promote_args<T, U>::type,
+         typename tools::promote_args<T, U, V>::type
+      >::type type;
+   };
+
+   } // namespace detail
+
+
+   template <class T1, class T2, class T3>
+   typename detail::ellint_3_result<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi);
+
+   template <class T1, class T2, class T3, class Policy>
+   typename tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v);
+
+   // Factorial functions.
+   // Note: not for integral types, at present.
+   template <class RT>
+   struct max_factorial;
+   template <class RT>
+   RT factorial(unsigned int);
+   template <class RT, class Policy>
+   RT factorial(unsigned int, const Policy& pol);
+   template <class RT>
+   RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT));
+   template <class RT>
+   RT double_factorial(unsigned i);
+   template <class RT, class Policy>
+   RT double_factorial(unsigned i, const Policy& pol);
+
+   template <class RT>
+   typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
+
+   template <class RT>
+   typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
+
+   // Gamma functions.
+   template <class RT>
+   typename tools::promote_args<RT>::type tgamma(RT z);
+
+   template <class RT>
+   typename tools::promote_args<RT>::type tgamma1pm1(RT z);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type tgamma1pm1(RT z, const Policy& pol);
+
+   template <class RT1, class RT2>
+   typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z);
+
+   template <class RT1, class RT2, class Policy>
+   typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z, const Policy& pol);
+
+   template <class RT>
+   typename tools::promote_args<RT>::type lgamma(RT z, int* sign);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type lgamma(RT z, int* sign, const Policy& pol);
+
+   template <class RT>
+   typename tools::promote_args<RT>::type lgamma(RT x);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type lgamma(RT x, const Policy& pol);
+
+   template <class RT1, class RT2>
+   typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z);
+
+   template <class RT1, class RT2, class Policy>
+   typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z, const Policy&);
+
+   template <class RT1, class RT2>
+   typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z);
+
+   template <class RT1, class RT2, class Policy>
+   typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z, const Policy&);
+
+   template <class RT1, class RT2>
+   typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z);
+
+   template <class RT1, class RT2, class Policy>
+   typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x, const Policy&);
+
+   // gamma inverse.
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q, const Policy&);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q, const Policy&);
+
+   // digamma:
+   template <class T>
+   typename tools::promote_args<T>::type digamma(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type digamma(T x, const Policy&);
+
+   // Hypotenuse function sqrt(x ^ 2 + y ^ 2).
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type
+         hypot(T1 x, T2 y);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type
+         hypot(T1 x, T2 y, const Policy&);
+
+   // cbrt - cube root.
+   template <class RT>
+   typename tools::promote_args<RT>::type cbrt(RT z);
+
+   template <class RT, class Policy>
+   typename tools::promote_args<RT>::type cbrt(RT z, const Policy&);
+
+   // log1p is log(x + 1)
+   template <class T>
+   typename tools::promote_args<T>::type log1p(T);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type log1p(T, const Policy&);
+
+   // log1pmx is log(x + 1) - x
+   template <class T>
+   typename tools::promote_args<T>::type log1pmx(T);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type log1pmx(T, const Policy&);
+
+   // Exp (x) minus 1 functions.
+   template <class T>
+   typename tools::promote_args<T>::type expm1(T);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type expm1(T, const Policy&);
+
+   // Power - 1
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type
+         powm1(const T1 a, const T2 z);
+
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type
+         powm1(const T1 a, const T2 z, const Policy&);
+
+   // sqrt(1+x) - 1
+   template <class T>
+   typename tools::promote_args<T>::type sqrt1pm1(const T& val);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy&);
+
+   // sinus cardinals:
+   template <class T>
+   typename tools::promote_args<T>::type sinc_pi(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type sinc_pi(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type sinhc_pi(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type sinhc_pi(T x, const Policy&);
+
+   // inverse hyperbolics:
+   template<typename T>
+   typename tools::promote_args<T>::type asinh(T x);
+
+   template<typename T, class Policy>
+   typename tools::promote_args<T>::type asinh(T x, const Policy&);
+
+   template<typename T>
+   typename tools::promote_args<T>::type acosh(T x);
+
+   template<typename T, class Policy>
+   typename tools::promote_args<T>::type acosh(T x, const Policy&);
+
+   template<typename T>
+   typename tools::promote_args<T>::type atanh(T x);
+
+   template<typename T, class Policy>
+   typename tools::promote_args<T>::type atanh(T x, const Policy&);
+
+   namespace detail{
+
+      typedef mpl::int_<0> bessel_no_int_tag;      // No integer optimisation possible.
+      typedef mpl::int_<1> bessel_maybe_int_tag;   // Maybe integer optimisation.
+      typedef mpl::int_<2> bessel_int_tag;         // Definite integer optimistaion.
+
+      template <class T1, class T2, class Policy>
+      struct bessel_traits
+      {
+         typedef typename tools::promote_args<
+            T1, T2
+         >::type result_type;
+
+         typedef typename policies::precision<result_type, Policy>::type precision_type;
+
+         typedef typename mpl::if_<
+            mpl::or_<
+               mpl::less_equal<precision_type, mpl::int_<0> >,
+               mpl::greater<precision_type, mpl::int_<64> > >,
+            bessel_no_int_tag,
+            typename mpl::if_<
+               is_integral<T1>,
+               bessel_int_tag,
+               bessel_maybe_int_tag
+            >::type
+         >::type optimisation_tag;
+      };
+   } // detail
+
+   // Bessel functions:
+   template <class T1, class T2, class Policy>
+   typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j(T1 v, T2 x);
+
+   template <class T, class Policy>
+   typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel(unsigned v, T x, const Policy& pol);
+
+   template <class T>
+   typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel(unsigned v, T x);
+
+   template <class T1, class T2, class Policy>
+   typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i(T1 v, T2 x);
+
+   template <class T1, class T2, class Policy>
+   typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k(T1 v, T2 x);
+
+   template <class T1, class T2, class Policy>
+   typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann(T1 v, T2 x);
+
+   template <class T, class Policy>
+   typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann(unsigned v, T x, const Policy& pol);
+
+   template <class T>
+   typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
+
+   template <class T, class Policy>
+   typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
+
+   template <class T>
+   typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
+
+   template <class T, class OutputIterator>
+   OutputIterator cyl_bessel_j_zero(T v,
+                          int start_index,
+                          unsigned number_of_zeros,
+                          OutputIterator out_it);
+
+   template <class T, class OutputIterator, class Policy>
+   OutputIterator cyl_bessel_j_zero(T v,
+                          int start_index,
+                          unsigned number_of_zeros,
+                          OutputIterator out_it,
+                          const Policy&);
+
+   template <class T, class Policy>
+   typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
+
+   template <class T>
+   typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
+
+   template <class T, class OutputIterator>
+   OutputIterator cyl_neumann_zero(T v,
+                         int start_index,
+                         unsigned number_of_zeros,
+                         OutputIterator out_it);
+
+   template <class T, class OutputIterator, class Policy>
+   OutputIterator cyl_neumann_zero(T v,
+                         int start_index,
+                         unsigned number_of_zeros,
+                         OutputIterator out_it,
+                         const Policy&);
+
+   template <class T1, class T2>
+   std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
+
+   template <class T1, class T2, class Policy>
+   std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2, class Policy>
+   std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
+
+   template <class T1, class T2, class Policy>
+   std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
+
+   template <class T1, class T2, class Policy>
+   std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
+
+   template <class T1, class T2>
+   std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type airy_ai(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type airy_ai(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type airy_bi(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type airy_bi(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type airy_ai_prime(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type airy_ai_prime(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type airy_bi_prime(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type airy_bi_prime(T x);
+
+   template <class T>
+   T airy_ai_zero(unsigned m);
+   template <class T, class Policy>
+   T airy_ai_zero(unsigned m, const Policy&);
+
+   template <class OutputIterator>
+   OutputIterator airy_ai_zero(
+                     unsigned start_index,
+                     unsigned number_of_zeros,
+                     OutputIterator out_it);
+   template <class OutputIterator, class Policy>
+   OutputIterator airy_ai_zero(
+                     unsigned start_index,
+                     unsigned number_of_zeros,
+                     OutputIterator out_it,
+                     const Policy&);
+
+   template <class T>
+   T airy_bi_zero(unsigned m);
+   template <class T, class Policy>
+   T airy_bi_zero(unsigned m, const Policy&);
+
+   template <class OutputIterator>
+   OutputIterator airy_bi_zero(
+                     unsigned start_index,
+                     unsigned number_of_zeros,
+                     OutputIterator out_it);
+   template <class OutputIterator, class Policy>
+   OutputIterator airy_bi_zero(
+                     unsigned start_index,
+                     unsigned number_of_zeros,
+                     OutputIterator out_it,
+                     const Policy&);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type sin_pi(T x);
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
+
+   template <class T>
+   typename tools::promote_args<T>::type cos_pi(T x);
+
+   template <class T>
+   int fpclassify BOOST_NO_MACRO_EXPAND(T t);
+
+   template <class T>
+   bool isfinite BOOST_NO_MACRO_EXPAND(T z);
+
+   template <class T>
+   bool isinf BOOST_NO_MACRO_EXPAND(T t);
+
+   template <class T>
+   bool isnan BOOST_NO_MACRO_EXPAND(T t);
+
+   template <class T>
+   bool isnormal BOOST_NO_MACRO_EXPAND(T t);
+
+   template<class T>
+   int signbit BOOST_NO_MACRO_EXPAND(T x);
+
+   template <class T>
+   int sign BOOST_NO_MACRO_EXPAND(const T& z);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
+
+   template <class T>
+   typename tools::promote_args<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
+
+   // Exponential integrals:
+   namespace detail{
+
+   template <class T, class U>
+   struct expint_result
+   {
+      typedef typename mpl::if_<
+         policies::is_policy<U>,
+         typename tools::promote_args<T>::type,
+         typename tools::promote_args<U>::type
+      >::type type;
+   };
+
+   } // namespace detail
+
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type expint(unsigned n, T z, const Policy&);
+
+   template <class T, class U>
+   typename detail::expint_result<T, U>::type expint(T const z, U const u);
+
+   template <class T>
+   typename tools::promote_args<T>::type expint(T z);
+
+   // Zeta:
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type zeta(T s, const Policy&);
+
+   // Owen's T function:
+   template <class T1, class T2, class Policy>
+   typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
+
+   template <class T1, class T2>
+   typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
+
+   // Jacobi Functions:
+   template <class T, class U, class V, class Policy>
+   typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
+
+   template <class T, class U, class V>
+   typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
+
+   template <class U, class T, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
+
+   template <class U, class T>
+   typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta);
+
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta, const Policy& pol);
+
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta);
+
+
+   template <class T>
+   typename tools::promote_args<T>::type zeta(T s);
+
+   // pow:
+   template <int N, typename T, class Policy>
+   typename tools::promote_args<T>::type pow(T base, const Policy& policy);
+
+   template <int N, typename T>
+   typename tools::promote_args<T>::type pow(T base);
+
+   // next:
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type float_next(const T&, const Policy&);
+   template <class T>
+   typename tools::promote_args<T>::type float_next(const T&);
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
+   template <class T>
+   typename tools::promote_args<T>::type float_prior(const T&);
+   template <class T, class U, class Policy>
+   typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
+   template <class T, class U>
+   typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
+   template <class T, class Policy>
+   typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
+   template <class T>
+   typename tools::promote_args<T>::type float_advance(const T& val, int distance);
+
+    } // namespace math
+} // namespace ndnboost
+
+#ifdef BOOST_HAS_LONG_LONG
+#define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
+   \
+   template <class T>\
+   inline T modf(const T& v, ndnboost::long_long_type* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+   \
+   template <class T>\
+   inline ndnboost::long_long_type lltrunc(const T& v){ using ndnboost::math::lltrunc; return lltrunc(v, Policy()); }\
+   \
+   template <class T>\
+   inline ndnboost::long_long_type llround(const T& v){ using ndnboost::math::llround; return llround(v, Policy()); }\
+
+#else
+#define BOOST_MATH_DETAIL_LL_FUNC(Policy)
+#endif
+
+#define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
+   \
+   BOOST_MATH_DETAIL_LL_FUNC(Policy)\
+   \
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type \
+   beta(RT1 a, RT2 b) { return ::ndnboost::math::beta(a, b, Policy()); }\
+\
+   template <class RT1, class RT2, class A>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, A>::type \
+   beta(RT1 a, RT2 b, A x){ return ::ndnboost::math::beta(a, b, x, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   betac(RT1 a, RT2 b, RT3 x) { return ::ndnboost::math::betac(a, b, x, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibeta(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibeta(a, b, x, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibetac(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibetac(a, b, x, Policy()); }\
+\
+   template <class T1, class T2, class T3, class T4>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type  \
+   ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::ndnboost::math::ibeta_inv(a, b, p, py, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_inv(a, b, p, Policy()); }\
+\
+   template <class T1, class T2, class T3, class T4>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type \
+   ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::ndnboost::math::ibetac_inv(a, b, q, py, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_inva(a, b, p, Policy()); }\
+\
+   template <class T1, class T2, class T3>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+   ibetac_inva(T1 a, T2 b, T3 q){ return ::ndnboost::math::ibetac_inva(a, b, q, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_invb(a, b, p, Policy()); }\
+\
+   template <class T1, class T2, class T3>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+   ibetac_invb(T1 a, T2 b, T3 q){ return ::ndnboost::math::ibetac_invb(a, b, q, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::ndnboost::math::ibetac_inv(a, b, q, Policy()); }\
+\
+   template <class RT1, class RT2, class RT3>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+   ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibeta_derivative(a, b, x, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type erf(RT z) { return ::ndnboost::math::erf(z, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type erfc(RT z){ return ::ndnboost::math::erfc(z, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type erf_inv(RT z) { return ::ndnboost::math::erf_inv(z, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type erfc_inv(RT z){ return ::ndnboost::math::erfc_inv(z, Policy()); }\
+\
+   using ndnboost::math::legendre_next;\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type \
+   legendre_p(int l, T x){ return ::ndnboost::math::legendre_p(l, x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type \
+   legendre_q(unsigned l, T x){ return ::ndnboost::math::legendre_q(l, x, Policy()); }\
+\
+   using ::ndnboost::math::legendre_next;\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type \
+   legendre_p(int l, int m, T x){ return ::ndnboost::math::legendre_p(l, m, x, Policy()); }\
+\
+   using ::ndnboost::math::laguerre_next;\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type \
+   laguerre(unsigned n, T x){ return ::ndnboost::math::laguerre(n, x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::laguerre_result<T1, T2>::type \
+   laguerre(unsigned n, T1 m, T2 x) { return ::ndnboost::math::laguerre(n, m, x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type \
+   hermite(unsigned n, T x){ return ::ndnboost::math::hermite(n, x, Policy()); }\
+\
+   using ndnboost::math::hermite_next;\
+\
+   template <class T1, class T2>\
+   inline std::complex<typename ndnboost::math::tools::promote_args<T1, T2>::type> \
+   spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return ndnboost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+   spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::ndnboost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+   spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return ndnboost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\
+\
+   template <class T1, class T2, class Policy>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+      spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\
+\
+   template <class T1, class T2, class T3>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+   ellint_rf(T1 x, T2 y, T3 z){ return ::ndnboost::math::ellint_rf(x, y, z, Policy()); }\
+\
+   template <class T1, class T2, class T3>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+   ellint_rd(T1 x, T2 y, T3 z){ return ::ndnboost::math::ellint_rd(x, y, z, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+   ellint_rc(T1 x, T2 y){ return ::ndnboost::math::ellint_rc(x, y, Policy()); }\
+\
+   template <class T1, class T2, class T3, class T4>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type \
+   ellint_rj(T1 x, T2 y, T3 z, T4 p){ return ndnboost::math::ellint_rj(x, y, z, p, Policy()); }\
+\
+   template <typename T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type ellint_2(T k){ return ndnboost::math::ellint_2(k, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi){ return ndnboost::math::ellint_2(k, phi, Policy()); }\
+\
+   template <typename T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type ellint_1(T k){ return ndnboost::math::ellint_1(k, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi){ return ndnboost::math::ellint_1(k, phi, Policy()); }\
+\
+   template <class T1, class T2, class T3>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi){ return ndnboost::math::ellint_3(k, v, phi, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v){ return ndnboost::math::ellint_3(k, v, Policy()); }\
+\
+   using ndnboost::math::max_factorial;\
+   template <class RT>\
+   inline RT factorial(unsigned int i) { return ndnboost::math::factorial<RT>(i, Policy()); }\
+   using ndnboost::math::unchecked_factorial;\
+   template <class RT>\
+   inline RT double_factorial(unsigned i){ return ndnboost::math::double_factorial<RT>(i, Policy()); }\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type falling_factorial(RT x, unsigned n){ return ndnboost::math::falling_factorial(x, n, Policy()); }\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type rising_factorial(RT x, unsigned n){ return ndnboost::math::rising_factorial(x, n, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type tgamma(RT z){ return ndnboost::math::tgamma(z, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type tgamma1pm1(RT z){ return ndnboost::math::tgamma1pm1(z, Policy()); }\
+\
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z){ return ndnboost::math::tgamma(a, z, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type lgamma(RT z, int* sign){ return ndnboost::math::lgamma(z, sign, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type lgamma(RT x){ return ndnboost::math::lgamma(x, Policy()); }\
+\
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z){ return ndnboost::math::tgamma_lower(a, z, Policy()); }\
+\
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z){ return ndnboost::math::gamma_q(a, z, Policy()); }\
+\
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z){ return ndnboost::math::gamma_p(a, z, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta){ return ndnboost::math::tgamma_delta_ratio(z, delta, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b) { return ndnboost::math::tgamma_ratio(a, b, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x){ return ndnboost::math::gamma_p_derivative(a, x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p){ return ndnboost::math::gamma_p_inv(a, p, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p){ return ndnboost::math::gamma_p_inva(a, p, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q){ return ndnboost::math::gamma_q_inv(a, q, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q){ return ndnboost::math::gamma_q_inva(a, q, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type digamma(T x){ return ndnboost::math::digamma(x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+   hypot(T1 x, T2 y){ return ndnboost::math::hypot(x, y, Policy()); }\
+\
+   template <class RT>\
+   inline typename ndnboost::math::tools::promote_args<RT>::type cbrt(RT z){ return ndnboost::math::cbrt(z, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type log1p(T x){ return ndnboost::math::log1p(x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type log1pmx(T x){ return ndnboost::math::log1pmx(x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type expm1(T x){ return ndnboost::math::expm1(x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+   powm1(const T1 a, const T2 z){ return ndnboost::math::powm1(a, z, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type sqrt1pm1(const T& val){ return ndnboost::math::sqrt1pm1(val, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type sinc_pi(T x){ return ndnboost::math::sinc_pi(x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type sinhc_pi(T x){ return ndnboost::math::sinhc_pi(x, Policy()); }\
+\
+   template<typename T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type asinh(const T x){ return ndnboost::math::asinh(x, Policy()); }\
+\
+   template<typename T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type acosh(const T x){ return ndnboost::math::acosh(x, Policy()); }\
+\
+   template<typename T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type atanh(const T x){ return ndnboost::math::atanh(x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j(T1 v, T2 x)\
+   { return ndnboost::math::cyl_bessel_j(v, x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel(unsigned v, T x)\
+   { return ndnboost::math::sph_bessel(v, x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+   cyl_bessel_i(T1 v, T2 x) { return ndnboost::math::cyl_bessel_i(v, x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+   cyl_bessel_k(T1 v, T2 x) { return ndnboost::math::cyl_bessel_k(v, x, Policy()); }\
+\
+   template <class T1, class T2>\
+   inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+   cyl_neumann(T1 v, T2 x){ return ndnboost::math::cyl_neumann(v, x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type \
+   sph_neumann(unsigned v, T x){ return ndnboost::math::sph_neumann(v, x, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
+   { return ndnboost::math::cyl_bessel_j_zero(v, m, Policy()); }\
+\
+template <class OutputIterator, class T>\
+   inline void cyl_bessel_j_zero(T v,\
+                                 int start_index,\
+                                 unsigned number_of_zeros,\
+                                 OutputIterator out_it)\
+   { ndnboost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
+   { return ndnboost::math::cyl_neumann_zero(v, m, Policy()); }\
+\
+template <class OutputIterator, class T>\
+   inline void cyl_neumann_zero(T v,\
+                                int start_index,\
+                                unsigned number_of_zeros,\
+                                OutputIterator out_it)\
+   { ndnboost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type sin_pi(T x){ return ndnboost::math::sin_pi(x); }\
+\
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type cos_pi(T x){ return ndnboost::math::cos_pi(x); }\
+\
+   using ndnboost::math::fpclassify;\
+   using ndnboost::math::isfinite;\
+   using ndnboost::math::isinf;\
+   using ndnboost::math::isnan;\
+   using ndnboost::math::isnormal;\
+   using ndnboost::math::signbit;\
+   using ndnboost::math::sign;\
+   using ndnboost::math::copysign;\
+   using ndnboost::math::changesign;\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T,U>::type expint(T const& z, U const& u)\
+   { return ndnboost::math::expint(z, u, Policy()); }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type expint(T z){ return ndnboost::math::expint(z, Policy()); }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type zeta(T s){ return ndnboost::math::zeta(s, Policy()); }\
+   \
+   template <class T>\
+   inline T round(const T& v){ using ndnboost::math::round; return round(v, Policy()); }\
+   \
+   template <class T>\
+   inline int iround(const T& v){ using ndnboost::math::iround; return iround(v, Policy()); }\
+   \
+   template <class T>\
+   inline long lround(const T& v){ using ndnboost::math::lround; return lround(v, Policy()); }\
+   \
+   template <class T>\
+   inline T trunc(const T& v){ using ndnboost::math::trunc; return trunc(v, Policy()); }\
+   \
+   template <class T>\
+   inline int itrunc(const T& v){ using ndnboost::math::itrunc; return itrunc(v, Policy()); }\
+   \
+   template <class T>\
+   inline long ltrunc(const T& v){ using ndnboost::math::ltrunc; return ltrunc(v, Policy()); }\
+   \
+   template <class T>\
+   inline T modf(const T& v, T* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+   \
+   template <class T>\
+   inline T modf(const T& v, int* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+   \
+   template <class T>\
+   inline T modf(const T& v, long* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+   \
+   template <int N, class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type pow(T v){ return ndnboost::math::pow<N>(v, Policy()); }\
+   \
+   template <class T> T nextafter(const T& a, const T& b){ return ndnboost::math::nextafter(a, b, Policy()); }\
+   template <class T> T float_next(const T& a){ return ndnboost::math::float_next(a, Policy()); }\
+   template <class T> T float_prior(const T& a){ return ndnboost::math::float_prior(a, Policy()); }\
+   template <class T> T float_distance(const T& a, const T& b){ return ndnboost::math::float_distance(a, b, Policy()); }\
+   \
+   template <class RT1, class RT2>\
+   inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return ndnboost::math::owens_t(a, z, Policy()); }\
+   \
+   template <class T1, class T2>\
+   inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
+   {  return ndnboost::math::cyl_hankel_1(v, x, Policy()); }\
+   \
+   template <class T1, class T2>\
+   inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
+   { return ndnboost::math::cyl_hankel_2(v, x, Policy()); }\
+   \
+   template <class T1, class T2>\
+   inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
+   { return ndnboost::math::sph_hankel_1(v, x, Policy()); }\
+   \
+   template <class T1, class T2>\
+   inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
+   { return ndnboost::math::sph_hankel_2(v, x, Policy()); }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)\
+   { return ndnboost::math::jacobi_elliptic(k, theta, pcn, pdn, Policy()); }\
+   \
+   template <class U, class T>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sn(U k, T theta)\
+   { return ndnboost::math::jacobi_sn(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cn(T k, U theta)\
+   { return ndnboost::math::jacobi_cn(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_dn(T k, U theta)\
+   { return ndnboost::math::jacobi_dn(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cd(T k, U theta)\
+   { return ndnboost::math::jacobi_cd(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_dc(T k, U theta)\
+   { return ndnboost::math::jacobi_dc(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_ns(T k, U theta)\
+   { return ndnboost::math::jacobi_ns(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sd(T k, U theta)\
+   { return ndnboost::math::jacobi_sd(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_ds(T k, U theta)\
+   { return ndnboost::math::jacobi_ds(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_nc(T k, U theta)\
+   { return ndnboost::math::jacobi_nc(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_nd(T k, U theta)\
+   { return ndnboost::math::jacobi_nd(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sc(T k, U theta)\
+   { return ndnboost::math::jacobi_sc(k, theta, Policy()); }\
+   \
+   template <class T, class U>\
+   inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cs(T k, U theta)\
+   { return ndnboost::math::jacobi_cs(k, theta, Policy()); }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type airy_ai(T x)\
+   {  return ndnboost::math::airy_ai(x, Policy());  }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type airy_bi(T x)\
+   {  return ndnboost::math::airy_bi(x, Policy());  }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type airy_ai_prime(T x)\
+   {  return ndnboost::math::airy_ai_prime(x, Policy());  }\
+   \
+   template <class T>\
+   inline typename ndnboost::math::tools::promote_args<T>::type airy_bi_prime(T x)\
+   {  return ndnboost::math::airy_bi_prime(x, Policy());  }\
+   \
+   template <class T>\
+   inline T airy_ai_zero(int m)\
+   { return ndnboost::math::airy_ai_zero<T>(m, Policy()); }\
+   template <class T, class OutputIterator>\
+   OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
+   { return ndnboost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
+   \
+   template <class T>\
+   inline T airy_bi_zero(int m)\
+   { return ndnboost::math::airy_bi_zero<T>(m, Policy()); }\
+   template <class T, class OutputIterator>\
+   OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
+   { return ndnboost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
+   \
+
+
+
+
+
+#endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP
+
+
diff --git a/ndnboost/math/special_functions/sign.hpp b/ndnboost/math/special_functions/sign.hpp
new file mode 100644
index 0000000..fecacfb
--- /dev/null
+++ b/ndnboost/math/special_functions/sign.hpp
@@ -0,0 +1,150 @@
+//  (C) Copyright John Maddock 2006.
+//  (C) Copyright Johan Rade 2006.
+//  (C) Copyright Paul A. Bristow 2011 (added changesign).
+
+//  Use, modification and distribution are subject to the
+//  Boost Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_TOOLS_SIGN_HPP
+#define BOOST_MATH_TOOLS_SIGN_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <ndnboost/math/tools/config.hpp>
+#include <ndnboost/math/special_functions/math_fwd.hpp>
+#include <ndnboost/math/special_functions/detail/fp_traits.hpp>
+
+namespace ndnboost{ namespace math{ 
+
+namespace detail {
+
+  // signbit
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+    template<class T> 
+    inline int signbit_impl(T x, native_tag const&)
+    {
+        return (std::signbit)(x);
+    }
+#endif
+
+    template<class T> 
+    inline int signbit_impl(T x, generic_tag<true> const&)
+    {
+        return x < 0;
+    }
+
+    template<class T> 
+    inline int signbit_impl(T x, generic_tag<false> const&)
+    {
+        return x < 0;
+    }
+
+    template<class T> 
+    inline int signbit_impl(T x, ieee_copy_all_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        return a & traits::sign ? 1 : 0;
+    }
+
+    template<class T> 
+    inline int signbit_impl(T x, ieee_copy_leading_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+
+        return a & traits::sign ? 1 : 0;
+    }
+
+    // Changesign
+
+    template<class T>
+    inline T (changesign_impl)(T x, generic_tag<true> const&)
+    {
+        return -x;
+    }
+
+    template<class T>
+    inline T (changesign_impl)(T x, generic_tag<false> const&)
+    {
+        return -x;
+    }
+
+
+    template<class T>
+    inline T changesign_impl(T x, ieee_copy_all_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::sign_change_type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a ^= traits::sign;
+        traits::set_bits(x,a);
+        return x;
+    }
+
+    template<class T>
+    inline T (changesign_impl)(T x, ieee_copy_leading_bits_tag const&)
+    {
+        typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::sign_change_type traits;
+
+        BOOST_DEDUCED_TYPENAME traits::bits a;
+        traits::get_bits(x,a);
+        a ^= traits::sign;
+        traits::set_bits(x,a);
+        return x;
+    }
+
+
+}   // namespace detail
+
+template<class T> int (signbit)(T x)
+{ 
+   typedef typename detail::fp_traits<T>::type traits;
+   typedef typename traits::method method;
+   // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   typedef typename tools::promote_args<T>::type result_type;
+   return detail::signbit_impl(static_cast<result_type>(x), method());
+}
+
+template <class T>
+inline int sign BOOST_NO_MACRO_EXPAND(const T& z)
+{
+   return (z == 0) ? 0 : (ndnboost::math::signbit)(z) ? -1 : 1;
+}
+
+template <class T> typename tools::promote_args<T>::type (changesign)(const T& x)
+{ //!< \brief return unchanged binary pattern of x, except for change of sign bit. 
+   typedef typename detail::fp_traits<T>::sign_change_type traits;
+   typedef typename traits::method method;
+   // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+   typedef typename tools::promote_args<T>::type result_type;
+
+   return detail::changesign_impl(static_cast<result_type>(x), method());
+}
+
+template <class T, class U>
+inline typename tools::promote_args<T, U>::type 
+   copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y)
+{
+   BOOST_MATH_STD_USING
+   typedef typename tools::promote_args<T, U>::type result_type;
+   return (ndnboost::math::signbit)(static_cast<result_type>(x)) != (ndnboost::math::signbit)(static_cast<result_type>(y)) 
+      ? (ndnboost::math::changesign)(static_cast<result_type>(x)) : static_cast<result_type>(x);
+}
+
+} // namespace math
+} // namespace ndnboost
+
+
+#endif // BOOST_MATH_TOOLS_SIGN_HPP
+
+
