Warning, file /include/boost/math/tools/detail/rational_horner1_2.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_MATH_TOOLS_POLY_RAT_2_HPP
0010 #define BOOST_MATH_TOOLS_POLY_RAT_2_HPP
0011
0012 namespace boost{ namespace math{ namespace tools{ namespace detail{
0013
0014 template <class T, class U, class V>
0015 BOOST_MATH_GPU_ENABLED inline V evaluate_rational_c_imp(const T*, const U*, const V&, const boost::math::integral_constant<int, 0>*) BOOST_MATH_NOEXCEPT(V)
0016 {
0017 return static_cast<V>(0);
0018 }
0019
0020 template <class T, class U, class V>
0021 BOOST_MATH_GPU_ENABLED inline V evaluate_rational_c_imp(const T* a, const U* b, const V&, const boost::math::integral_constant<int, 1>*) BOOST_MATH_NOEXCEPT(V)
0022 {
0023 return static_cast<V>(a[0]) / static_cast<V>(b[0]);
0024 }
0025
0026 template <class T, class U, class V>
0027 BOOST_MATH_GPU_ENABLED inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const boost::math::integral_constant<int, 2>*) BOOST_MATH_NOEXCEPT(V)
0028 {
0029 if((-1 <= x) && (x <= 1))
0030 return static_cast<V>((a[1] * x + a[0]) / (b[1] * x + b[0]));
0031 else
0032 {
0033 V z = 1 / x;
0034 return static_cast<V>((a[0] * z + a[1]) / (b[0] * z + b[1]));
0035 }
0036 }
0037
0038
0039 }}}}
0040
0041 #endif
0042