File indexing completed on 2025-01-18 09:40:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
0010 #define BOOST_MATH_TOOLS_POLY_EVAL_4_HPP
0011
0012 namespace boost{ namespace math{ namespace tools{ namespace detail{
0013
0014 template <class T, class V>
0015 inline V evaluate_polynomial_c_imp(const T*, const V&, const std::integral_constant<int, 0>*) BOOST_MATH_NOEXCEPT(V)
0016 {
0017 return static_cast<V>(0);
0018 }
0019
0020 template <class T, class V>
0021 inline V evaluate_polynomial_c_imp(const T* a, const V&, const std::integral_constant<int, 1>*) BOOST_MATH_NOEXCEPT(V)
0022 {
0023 return static_cast<V>(a[0]);
0024 }
0025
0026 template <class T, class V>
0027 inline V evaluate_polynomial_c_imp(const T* a, const V& x, const std::integral_constant<int, 2>*) BOOST_MATH_NOEXCEPT(V)
0028 {
0029 return static_cast<V>(a[1] * x + a[0]);
0030 }
0031
0032 template <class T, class V>
0033 inline V evaluate_polynomial_c_imp(const T* a, const V& x, const std::integral_constant<int, 3>*) BOOST_MATH_NOEXCEPT(V)
0034 {
0035 return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
0036 }
0037
0038 template <class T, class V>
0039 inline V evaluate_polynomial_c_imp(const T* a, const V& x, const std::integral_constant<int, 4>*) BOOST_MATH_NOEXCEPT(V)
0040 {
0041 return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
0042 }
0043
0044
0045 }}}}
0046
0047 #endif
0048