Imported existing code
This commit is contained in:
294
libraries/include/boost/math/tools/config.hpp
Normal file
294
libraries/include/boost/math/tools/config.hpp
Normal file
@@ -0,0 +1,294 @@
|
||||
// Copyright (c) 2006-7 John Maddock
|
||||
// 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_CONFIG_HPP
|
||||
#define BOOST_MATH_TOOLS_CONFIG_HPP
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/cstdint.hpp> // for boost::uintmax_t
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <algorithm> // for min and max
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <climits>
|
||||
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
#include <boost/math/tools/user.hpp>
|
||||
#include <boost/math/special_functions/detail/round_fwd.hpp>
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \
|
||||
|| defined(__hppa) || defined(__NO_LONG_DOUBLE_MATH)
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
|
||||
//
|
||||
// Borland post 5.8.2 uses Dinkumware's std C lib which
|
||||
// doesn't have true long double precision. Earlier
|
||||
// versions are problematic too:
|
||||
//
|
||||
# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
|
||||
# include <float.h>
|
||||
#endif
|
||||
#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106))
|
||||
//
|
||||
// Darwin's rather strange "double double" is rather hard to
|
||||
// support, it should be possible given enough effort though...
|
||||
//
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
#if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000)
|
||||
//
|
||||
// Intel compiler prior to version 10 has sporadic problems
|
||||
// calling the long double overloads of the std lib math functions:
|
||||
// calling ::powl is OK, but std::pow(long double, long double)
|
||||
// may segfault depending upon the value of the arguments passed
|
||||
// and the specific Linux distribution.
|
||||
//
|
||||
// We'll be conservative and disable long double support for this compiler.
|
||||
//
|
||||
// Comment out this #define and try building the tests to determine whether
|
||||
// your Intel compiler version has this issue or not.
|
||||
//
|
||||
# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MSVC) && !defined(_WIN32_WCE)
|
||||
// Better safe than sorry, our tests don't support hardware exceptions:
|
||||
# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
|
||||
#endif
|
||||
|
||||
#ifdef __IBMCPP__
|
||||
# define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS
|
||||
#endif
|
||||
|
||||
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901))
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if (defined(__hpux) && !defined(__hppa))
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(_GLIBCXX_USE_C99)
|
||||
# define BOOST_MATH_USE_C99
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
|
||||
|| defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
|
||||
|| (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
|
||||
# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
|
||||
|
||||
# include "boost/type.hpp"
|
||||
# include "boost/non_type.hpp"
|
||||
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
|
||||
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
|
||||
, BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
#else
|
||||
|
||||
// no workaround needed: expand to nothing
|
||||
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
|
||||
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) || defined(__hppa)
|
||||
// Sun's compiler emits a hard error if a constant underflows,
|
||||
// as does aCC on PA-RISC:
|
||||
# define BOOST_MATH_SMALL_CONSTANT(x) 0
|
||||
#else
|
||||
# define BOOST_MATH_SMALL_CONSTANT(x) x
|
||||
#endif
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
|
||||
//
|
||||
// Define if constants too large for a float cause "bad"
|
||||
// values to be stored in the data, rather than infinity
|
||||
// or a suitably large value.
|
||||
//
|
||||
# define BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
|
||||
#endif
|
||||
//
|
||||
// Tune performance options for specific compilers:
|
||||
//
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_MATH_POLY_METHOD 3
|
||||
#elif defined(BOOST_INTEL)
|
||||
# define BOOST_MATH_POLY_METHOD 2
|
||||
# define BOOST_MATH_RATIONAL_METHOD 2
|
||||
#elif defined(__GNUC__)
|
||||
# define BOOST_MATH_POLY_METHOD 3
|
||||
# define BOOST_MATH_RATIONAL_METHOD 3
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_LONG_LONG) && !defined(BOOST_MATH_INT_TABLE_TYPE)
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
|
||||
#endif
|
||||
|
||||
//
|
||||
// The maximum order of polynomial that will be evaluated
|
||||
// via an unrolled specialisation:
|
||||
//
|
||||
#ifndef BOOST_MATH_MAX_POLY_ORDER
|
||||
# define BOOST_MATH_MAX_POLY_ORDER 17
|
||||
#endif
|
||||
//
|
||||
// Set the method used to evaluate polynomials and rationals:
|
||||
//
|
||||
#ifndef BOOST_MATH_POLY_METHOD
|
||||
# define BOOST_MATH_POLY_METHOD 1
|
||||
#endif
|
||||
#ifndef BOOST_MATH_RATIONAL_METHOD
|
||||
# define BOOST_MATH_RATIONAL_METHOD 0
|
||||
#endif
|
||||
//
|
||||
// decide whether to store constants as integers or reals:
|
||||
//
|
||||
#ifndef BOOST_MATH_INT_TABLE_TYPE
|
||||
# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
|
||||
#endif
|
||||
#ifndef BOOST_MATH_INT_VALUE_SUFFIX
|
||||
# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF
|
||||
#endif
|
||||
|
||||
//
|
||||
// Helper macro for controlling the FP behaviour:
|
||||
//
|
||||
#ifndef BOOST_MATH_CONTROL_FP
|
||||
# define BOOST_MATH_CONTROL_FP
|
||||
#endif
|
||||
//
|
||||
// Helper macro for using statements:
|
||||
//
|
||||
#define BOOST_MATH_STD_USING \
|
||||
using std::abs;\
|
||||
using std::acos;\
|
||||
using std::cos;\
|
||||
using std::fmod;\
|
||||
using std::modf;\
|
||||
using std::tan;\
|
||||
using std::asin;\
|
||||
using std::cosh;\
|
||||
using std::frexp;\
|
||||
using std::pow;\
|
||||
using std::tanh;\
|
||||
using std::atan;\
|
||||
using std::exp;\
|
||||
using std::ldexp;\
|
||||
using std::sin;\
|
||||
using std::atan2;\
|
||||
using std::fabs;\
|
||||
using std::log;\
|
||||
using std::sinh;\
|
||||
using std::ceil;\
|
||||
using std::floor;\
|
||||
using std::log10;\
|
||||
using std::sqrt;\
|
||||
using boost::math::round;\
|
||||
using boost::math::iround;\
|
||||
using boost::math::lround;\
|
||||
using boost::math::trunc;\
|
||||
using boost::math::itrunc;\
|
||||
using boost::math::ltrunc;\
|
||||
using boost::math::modf;
|
||||
|
||||
|
||||
namespace boost{ namespace math{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
template <class T>
|
||||
inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c)
|
||||
{
|
||||
return (std::max)((std::max)(a, b), c);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d)
|
||||
{
|
||||
return (std::max)((std::max)(a, b), (std::max)(c, d));
|
||||
}
|
||||
} // namespace tools
|
||||
}} // namespace boost namespace math
|
||||
|
||||
#if (defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
namespace boost{ namespace math{
|
||||
namespace detail
|
||||
{
|
||||
struct fpu_guard
|
||||
{
|
||||
fpu_guard()
|
||||
{
|
||||
fegetexceptflag(&m_flags, FE_ALL_EXCEPT);
|
||||
feclearexcept(FE_ALL_EXCEPT);
|
||||
}
|
||||
~fpu_guard()
|
||||
{
|
||||
fesetexceptflag(&m_flags, FE_ALL_EXCEPT);
|
||||
}
|
||||
private:
|
||||
fexcept_t m_flags;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
}} // namespaces
|
||||
|
||||
#define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object;
|
||||
#else // All other platforms.
|
||||
#define BOOST_FPU_EXCEPTION_GUARD
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MATH_INSTRUMENT
|
||||
#define BOOST_MATH_INSTRUMENT_CODE(x) \
|
||||
std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl;
|
||||
#define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name)
|
||||
#else
|
||||
#define BOOST_MATH_INSTRUMENT_CODE(x)
|
||||
#define BOOST_MATH_INSTRUMENT_VARIABLE(name)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MATH_TOOLS_CONFIG_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
return static_cast<V>((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<20>*)
|
||||
{
|
||||
return static_cast<V>(((((((((((((((((((a[19] * x + a[18]) * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<20>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[19] * x2 + a[17]) * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_14_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,336 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_16_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[15] * x2 + a[13];
|
||||
t[1] = a[14] * x2 + a[12];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,373 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_17_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[15] * x2 + a[13];
|
||||
t[1] = a[14] * x2 + a[12];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[16] * x2 + a[14]);
|
||||
t[1] = static_cast<V>(a[15] * x2 + a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_18_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[15] * x2 + a[13];
|
||||
t[1] = a[14] * x2 + a[12];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[16] * x2 + a[14]);
|
||||
t[1] = static_cast<V>(a[15] * x2 + a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[17] * x2 + a[15];
|
||||
t[1] = a[16] * x2 + a[14];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[13]);
|
||||
t[1] += static_cast<V>(a[12]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,453 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[15] * x2 + a[13];
|
||||
t[1] = a[14] * x2 + a[12];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[16] * x2 + a[14]);
|
||||
t[1] = static_cast<V>(a[15] * x2 + a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[17] * x2 + a[15];
|
||||
t[1] = a[16] * x2 + a[14];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[13]);
|
||||
t[1] += static_cast<V>(a[12]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[18] * x2 + a[16]);
|
||||
t[1] = static_cast<V>(a[17] * x2 + a[15]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[14]);
|
||||
t[1] += static_cast<V>(a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_2_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,496 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[10] * x2 + a[8]);
|
||||
t[1] = static_cast<V>(a[9] * x2 + a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[12] * x2 + a[10]);
|
||||
t[1] = static_cast<V>(a[11] * x2 + a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[13] * x2 + a[11];
|
||||
t[1] = a[12] * x2 + a[10];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[14] * x2 + a[12]);
|
||||
t[1] = static_cast<V>(a[13] * x2 + a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[15] * x2 + a[13];
|
||||
t[1] = a[14] * x2 + a[12];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[16] * x2 + a[14]);
|
||||
t[1] = static_cast<V>(a[15] * x2 + a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[17] * x2 + a[15];
|
||||
t[1] = a[16] * x2 + a[14];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[13]);
|
||||
t[1] += static_cast<V>(a[12]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[18] * x2 + a[16]);
|
||||
t[1] = static_cast<V>(a[17] * x2 + a[15]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[14]);
|
||||
t[1] += static_cast<V>(a[13]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<20>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[19] * x2 + a[17];
|
||||
t[1] = a[18] * x2 + a[16];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[15]);
|
||||
t[1] += static_cast<V>(a[14]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[13]);
|
||||
t[1] += static_cast<V>(a[12]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[11]);
|
||||
t[1] += static_cast<V>(a[10]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[9]);
|
||||
t[1] += static_cast<V>(a[8]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_5_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_6_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_7_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_8_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Unrolled polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_9_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[4] * x2 + a[2]);
|
||||
t[1] = static_cast<V>(a[3] * x2 + a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[6] * x2 + a[4]);
|
||||
t[1] = static_cast<V>(a[5] * x2 + a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[0] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[2];
|
||||
t[0] = static_cast<V>(a[8] * x2 + a[6]);
|
||||
t[1] = static_cast<V>(a[7] * x2 + a[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[0] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[1] *= x;
|
||||
return t[0] + t[1];
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_10_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_11_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_12_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_13_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_14_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_14_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_15_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_16_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_16_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_17_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_17_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((b[16] * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) / ((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_18_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_18_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((b[16] * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) / ((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((((b[17] * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) / (((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_19_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_19_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((b[16] * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) / ((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((((b[17] * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) / (((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((((b[18] * x + b[17]) * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) * z + a[18]) / ((((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]) * z + b[18]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_2_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_2_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_20_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((b[11] * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) / (((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((b[12] * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) / ((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((b[13] * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) / (((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((b[14] * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) / ((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((b[15] * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) / (((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((b[16] * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) / ((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((((b[17] * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) / (((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((((((((((b[18] * x + b[17]) * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) * z + a[18]) / ((((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]) * z + b[18]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<20>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((((((((((((((a[19] * x + a[18]) * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((((((((((((b[19] * x + b[18]) * x + b[17]) * x + b[16]) * x + b[15]) * x + b[14]) * x + b[13]) * x + b[12]) * x + b[11]) * x + b[10]) * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((((((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) * z + a[11]) * z + a[12]) * z + a[13]) * z + a[14]) * z + a[15]) * z + a[16]) * z + a[17]) * z + a[18]) * z + a[19]) / (((((((((((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]) * z + b[11]) * z + b[12]) * z + b[13]) * z + b[14]) * z + b[15]) * z + b[16]) * z + b[17]) * z + b[18]) * z + b[19]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_3_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_4_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_4_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_5_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_5_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_6_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_6_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
102
libraries/include/boost/math/tools/detail/rational_horner1_7.hpp
Normal file
102
libraries/include/boost/math/tools/detail/rational_horner1_7.hpp
Normal file
@@ -0,0 +1,102 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_7_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_7_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
114
libraries/include/boost/math/tools/detail/rational_horner1_8.hpp
Normal file
114
libraries/include/boost/math/tools/detail/rational_horner1_8.hpp
Normal file
@@ -0,0 +1,114 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_8_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_8_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
126
libraries/include/boost/math/tools/detail/rational_horner1_9.hpp
Normal file
126
libraries/include/boost/math/tools/detail/rational_horner1_9.hpp
Normal file
@@ -0,0 +1,126 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_RAT_9_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_RAT_9_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T*, const U*, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((a[0] * z + a[1]) * z + a[2]) / ((b[0] * z + b[1]) * z + b[2]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) / (((b[0] * z + b[1]) * z + b[2]) * z + b[3]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((b[4] * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) / ((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((b[5] * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) / (((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((b[6] * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) / ((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>((((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((b[7] * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) / (((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
return static_cast<V>(((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((b[8] * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
return static_cast<V>(((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_12_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_14_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_14_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_15_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_15_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_16_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_16_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_17_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_17_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16] + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16] + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_18_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_18_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16] + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16] + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_19_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_19_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16] + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16] + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((((b[18] * x2 + b[16]) * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z2 + a[18] + ((((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) * z) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z2 + b[18] + ((((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_2_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_2_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_20_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_20_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((a[9] * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((b[9] * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10] + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z) / (((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10] + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((a[10] * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((b[10] * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z + ((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z + ((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((a[11] * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((b[11] * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12] + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z) / ((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12] + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<14>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((a[12] * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((b[12] * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z + (((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z + (((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<15>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((a[13] * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((b[13] * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14] + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z) / (((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14] + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<16>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((a[14] * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((b[14] * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z + ((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z + ((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<17>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((((((a[15] * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((((((b[15] * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16] + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z) / ((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16] + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<18>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + (((((((a[16] * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / (((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + (((((((b[16] * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z + (((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z + (((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<19>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((((((((a[17] * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / (((((((((b[18] * x2 + b[16]) * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((((((((b[17] * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z2 + a[18] + ((((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) * z) / (((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z2 + b[18] + ((((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<20>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((((((((a[19] * x2 + a[17]) * x2 + a[15]) * x2 + a[13]) * x2 + a[11]) * x2 + a[9]) * x2 + a[7]) * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((((((((a[18] * x2 + a[16]) * x2 + a[14]) * x2 + a[12]) * x2 + a[10]) * x2 + a[8]) * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((((((((b[19] * x2 + b[17]) * x2 + b[15]) * x2 + b[13]) * x2 + b[11]) * x2 + b[9]) * x2 + b[7]) * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((((((((b[18] * x2 + b[16]) * x2 + b[14]) * x2 + b[12]) * x2 + b[10]) * x2 + b[8]) * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((((((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8]) * z2 + a[10]) * z2 + a[12]) * z2 + a[14]) * z2 + a[16]) * z2 + a[18]) * z + ((((((((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z2 + a[9]) * z2 + a[11]) * z2 + a[13]) * z2 + a[15]) * z2 + a[17]) * z2 + a[19]) / ((((((((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8]) * z2 + b[10]) * z2 + b[12]) * z2 + b[14]) * z2 + b[16]) * z2 + b[18]) * z + ((((((((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z2 + b[9]) * z2 + b[11]) * z2 + b[13]) * z2 + b[15]) * z2 + b[17]) * z2 + b[19]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_3_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_3_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_4_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_4_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_5_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_5_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_6_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_6_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_7_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_7_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
112
libraries/include/boost/math/tools/detail/rational_horner2_8.hpp
Normal file
112
libraries/include/boost/math/tools/detail/rational_horner2_8.hpp
Normal file
@@ -0,0 +1,112 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_8_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_8_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
128
libraries/include/boost/math/tools/detail/rational_horner2_9.hpp
Normal file
128
libraries/include/boost/math/tools/detail/rational_horner2_9.hpp
Normal file
@@ -0,0 +1,128 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_9_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_9_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((a[4] * x2 + a[2]) * x2 + a[0] + (a[3] * x2 + a[1]) * x) / ((b[4] * x2 + b[2]) * x2 + b[0] + (b[3] * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((a[0] * z2 + a[2]) * z2 + a[4] + (a[1] * z2 + a[3]) * z) / ((b[0] * z2 + b[2]) * z2 + b[4] + (b[1] * z2 + b[3]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[5] * x2 + a[3]) * x2 + a[1]) * x + (a[4] * x2 + a[2]) * x2 + a[0]) / (((b[5] * x2 + b[3]) * x2 + b[1]) * x + (b[4] * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z + (a[1] * z2 + a[3]) * z2 + a[5]) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z + (b[1] * z2 + b[3]) * z2 + b[5]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>((((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + ((a[5] * x2 + a[3]) * x2 + a[1]) * x) / (((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + ((b[5] * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6] + ((a[1] * z2 + a[3]) * z2 + a[5]) * z) / (((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6] + ((b[1] * z2 + b[3]) * z2 + b[5]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x + ((a[6] * x2 + a[4]) * x2 + a[2]) * x2 + a[0]) / ((((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x + ((b[6] * x2 + b[4]) * x2 + b[2]) * x2 + b[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z + ((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z + ((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]));
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
return static_cast<V>(((((a[8] * x2 + a[6]) * x2 + a[4]) * x2 + a[2]) * x2 + a[0] + (((a[7] * x2 + a[5]) * x2 + a[3]) * x2 + a[1]) * x) / ((((b[8] * x2 + b[6]) * x2 + b[4]) * x2 + b[2]) * x2 + b[0] + (((b[7] * x2 + b[5]) * x2 + b[3]) * x2 + b[1]) * x));
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
return static_cast<V>(((((a[0] * z2 + a[2]) * z2 + a[4]) * z2 + a[6]) * z2 + a[8] + (((a[1] * z2 + a[3]) * z2 + a[5]) * z2 + a[7]) * z) / ((((b[0] * z2 + b[2]) * z2 + b[4]) * z2 + b[6]) * z2 + b[8] + (((b[1] * z2 + b[3]) * z2 + b[5]) * z2 + b[7]) * z));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[4] * x2 + a[2];
|
||||
t[1] = a[3] * x2 + a[1];
|
||||
t[2] = b[4] * x2 + b[2];
|
||||
t[3] = b[3] * x2 + b[1];
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[2] = b[5] * x2 + b[3];
|
||||
t[3] = b[4] * x2 + b[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[6] * x2 + a[4];
|
||||
t[1] = a[5] * x2 + a[3];
|
||||
t[2] = b[6] * x2 + b[4];
|
||||
t[3] = b[5] * x2 + b[3];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[2] = b[7] * x2 + b[5];
|
||||
t[3] = b[6] * x2 + b[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[8] * x2 + a[6];
|
||||
t[1] = a[7] * x2 + a[5];
|
||||
t[2] = b[8] * x2 + b[6];
|
||||
t[3] = b[7] * x2 + b[5];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[2] = b[9] * x2 + b[7];
|
||||
t[3] = b[8] * x2 + b[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,482 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_11_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_11_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[4] * x2 + a[2];
|
||||
t[1] = a[3] * x2 + a[1];
|
||||
t[2] = b[4] * x2 + b[2];
|
||||
t[3] = b[3] * x2 + b[1];
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[2] = b[5] * x2 + b[3];
|
||||
t[3] = b[4] * x2 + b[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[6] * x2 + a[4];
|
||||
t[1] = a[5] * x2 + a[3];
|
||||
t[2] = b[6] * x2 + b[4];
|
||||
t[3] = b[5] * x2 + b[3];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[2] = b[7] * x2 + b[5];
|
||||
t[3] = b[6] * x2 + b[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[8] * x2 + a[6];
|
||||
t[1] = a[7] * x2 + a[5];
|
||||
t[2] = b[8] * x2 + b[6];
|
||||
t[3] = b[7] * x2 + b[5];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[2] = b[9] * x2 + b[7];
|
||||
t[3] = b[8] * x2 + b[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[10] * x2 + a[8];
|
||||
t[1] = a[9] * x2 + a[7];
|
||||
t[2] = b[10] * x2 + b[8];
|
||||
t[3] = b[9] * x2 + b[7];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,576 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_12_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_12_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[4] * x2 + a[2];
|
||||
t[1] = a[3] * x2 + a[1];
|
||||
t[2] = b[4] * x2 + b[2];
|
||||
t[3] = b[3] * x2 + b[1];
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[2] = b[5] * x2 + b[3];
|
||||
t[3] = b[4] * x2 + b[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[6] * x2 + a[4];
|
||||
t[1] = a[5] * x2 + a[3];
|
||||
t[2] = b[6] * x2 + b[4];
|
||||
t[3] = b[5] * x2 + b[3];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[2] = b[7] * x2 + b[5];
|
||||
t[3] = b[6] * x2 + b[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[8] * x2 + a[6];
|
||||
t[1] = a[7] * x2 + a[5];
|
||||
t[2] = b[8] * x2 + b[6];
|
||||
t[3] = b[7] * x2 + b[5];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[2] = b[9] * x2 + b[7];
|
||||
t[3] = b[8] * x2 + b[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[10] * x2 + a[8];
|
||||
t[1] = a[9] * x2 + a[7];
|
||||
t[2] = b[10] * x2 + b[8];
|
||||
t[3] = b[9] * x2 + b[7];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[2] = b[11] * x2 + b[9];
|
||||
t[3] = b[10] * x2 + b[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[7]);
|
||||
t[3] += static_cast<V>(b[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[3] += static_cast<V>(b[11]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,678 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using second order Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_RAT_EVAL_13_HPP
|
||||
#define BOOST_MATH_TOOLS_RAT_EVAL_13_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<0>*)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const mpl::int_<1>*)
|
||||
{
|
||||
return static_cast<V>(a[0]) / static_cast<V>(b[0]);
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<2>*)
|
||||
{
|
||||
return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<3>*)
|
||||
{
|
||||
return static_cast<V>(((a[2] * x + a[1]) * x + a[0]) / ((b[2] * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<4>*)
|
||||
{
|
||||
return static_cast<V>((((a[3] * x + a[2]) * x + a[1]) * x + a[0]) / (((b[3] * x + b[2]) * x + b[1]) * x + b[0]));
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<5>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[4] * x2 + a[2];
|
||||
t[1] = a[3] * x2 + a[1];
|
||||
t[2] = b[4] * x2 + b[2];
|
||||
t[3] = b[3] * x2 + b[1];
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<6>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[5] * x2 + a[3];
|
||||
t[1] = a[4] * x2 + a[2];
|
||||
t[2] = b[5] * x2 + b[3];
|
||||
t[3] = b[4] * x2 + b[2];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<7>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[6] * x2 + a[4];
|
||||
t[1] = a[5] * x2 + a[3];
|
||||
t[2] = b[6] * x2 + b[4];
|
||||
t[3] = b[5] * x2 + b[3];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<8>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[7] * x2 + a[5];
|
||||
t[1] = a[6] * x2 + a[4];
|
||||
t[2] = b[7] * x2 + b[5];
|
||||
t[3] = b[6] * x2 + b[4];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<9>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[8] * x2 + a[6];
|
||||
t[1] = a[7] * x2 + a[5];
|
||||
t[2] = b[8] * x2 + b[6];
|
||||
t[3] = b[7] * x2 + b[5];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[9] * x2 + a[7];
|
||||
t[1] = a[8] * x2 + a[6];
|
||||
t[2] = b[9] * x2 + b[7];
|
||||
t[3] = b[8] * x2 + b[6];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[10] * x2 + a[8];
|
||||
t[1] = a[9] * x2 + a[7];
|
||||
t[2] = b[10] * x2 + b[8];
|
||||
t[3] = b[9] * x2 + b[7];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[11] * x2 + a[9];
|
||||
t[1] = a[10] * x2 + a[8];
|
||||
t[2] = b[11] * x2 + b[9];
|
||||
t[3] = b[10] * x2 + b[8];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[7]);
|
||||
t[1] += static_cast<V>(a[6]);
|
||||
t[2] += static_cast<V>(b[7]);
|
||||
t[3] += static_cast<V>(b[6]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[5]);
|
||||
t[1] += static_cast<V>(a[4]);
|
||||
t[2] += static_cast<V>(b[5]);
|
||||
t[3] += static_cast<V>(b[4]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[3]);
|
||||
t[1] += static_cast<V>(a[2]);
|
||||
t[2] += static_cast<V>(b[3]);
|
||||
t[3] += static_cast<V>(b[2]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[1]);
|
||||
t[1] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[1]);
|
||||
t[3] += static_cast<V>(b[0]);
|
||||
t[0] *= x;
|
||||
t[2] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[3] += static_cast<V>(b[11]);
|
||||
t[0] *= z;
|
||||
t[2] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T, class U, class V>
|
||||
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<13>*)
|
||||
{
|
||||
if(x <= 1)
|
||||
{
|
||||
V x2 = x * x;
|
||||
V t[4];
|
||||
t[0] = a[12] * x2 + a[10];
|
||||
t[1] = a[11] * x2 + a[9];
|
||||
t[2] = b[12] * x2 + b[10];
|
||||
t[3] = b[11] * x2 + b[9];
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[3]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[3]);
|
||||
t[0] *= x2;
|
||||
t[1] *= x2;
|
||||
t[2] *= x2;
|
||||
t[3] *= x2;
|
||||
t[0] += static_cast<V>(a[2]);
|
||||
t[1] += static_cast<V>(a[1]);
|
||||
t[2] += static_cast<V>(b[2]);
|
||||
t[3] += static_cast<V>(b[1]);
|
||||
t[0] *= x2;
|
||||
t[2] *= x2;
|
||||
t[0] += static_cast<V>(a[0]);
|
||||
t[2] += static_cast<V>(b[0]);
|
||||
t[1] *= x;
|
||||
t[3] *= x;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
V z = 1 / x;
|
||||
V z2 = 1 / (x * x);
|
||||
V t[4];
|
||||
t[0] = a[0] * z2 + a[2];
|
||||
t[1] = a[1] * z2 + a[3];
|
||||
t[2] = b[0] * z2 + b[2];
|
||||
t[3] = b[1] * z2 + b[3];
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[4]);
|
||||
t[1] += static_cast<V>(a[5]);
|
||||
t[2] += static_cast<V>(b[4]);
|
||||
t[3] += static_cast<V>(b[5]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[6]);
|
||||
t[1] += static_cast<V>(a[7]);
|
||||
t[2] += static_cast<V>(b[6]);
|
||||
t[3] += static_cast<V>(b[7]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[8]);
|
||||
t[1] += static_cast<V>(a[9]);
|
||||
t[2] += static_cast<V>(b[8]);
|
||||
t[3] += static_cast<V>(b[9]);
|
||||
t[0] *= z2;
|
||||
t[1] *= z2;
|
||||
t[2] *= z2;
|
||||
t[3] *= z2;
|
||||
t[0] += static_cast<V>(a[10]);
|
||||
t[1] += static_cast<V>(a[11]);
|
||||
t[2] += static_cast<V>(b[10]);
|
||||
t[3] += static_cast<V>(b[11]);
|
||||
t[0] *= z2;
|
||||
t[2] *= z2;
|
||||
t[0] += static_cast<V>(a[12]);
|
||||
t[2] += static_cast<V>(b[12]);
|
||||
t[1] *= z;
|
||||
t[3] *= z;
|
||||
return (t[0] + t[1]) / (t[2] + t[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user