Boost logo

Boost-Commit :

From: johnmaddock_at_[hidden]
Date: 2007-05-22 04:53:01


Author: johnmaddock
Date: 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
New Revision: 4172
URL: http://svn.boost.org/trac/boost/changeset/4172

Log:
Added alternative polynomial and rational function evaluation methods.
Added new optimisation config options (still need documenting).
Tidied up use of instrumentation code so they all use BOOST_MATH_INSTRUMENT now.
Various tweaks to inverse incomplete beta and gamma to reduce number of iterations.
Changed incomplete gamma and beta to calculate derivative at the same time as the function (performance optimisation for inverses).
Fixed MinGW failures.
Refactored and extended rational / polynomial test cases.

Added:
   sandbox/math_toolkit/boost/math/tools/detail/
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_9.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_9.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_9.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_9.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_9.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_10.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_11.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_12.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_13.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_14.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_15.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_16.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_17.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_18.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_19.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_2.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_20.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_3.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_4.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_5.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_6.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_7.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_8.hpp
   sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_9.hpp
   sandbox/math_toolkit/libs/math/test/test_rational_double.cpp
   sandbox/math_toolkit/libs/math/test/test_rational_float.cpp
   sandbox/math_toolkit/libs/math/test/test_rational_ldouble.cpp
   sandbox/math_toolkit/libs/math/tools/generate_rational_code.cpp
Text files modified:
   sandbox/math_toolkit/boost/math/special_functions/beta.hpp | 372 +++--
   sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp | 82
   sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp | 33
   sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp | 190 +-
   sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp | 4
   sandbox/math_toolkit/boost/math/special_functions/gamma.hpp | 151 +
   sandbox/math_toolkit/boost/math/special_functions/lanczos.hpp | 46
   sandbox/math_toolkit/boost/math/tools/config.hpp | 42
   sandbox/math_toolkit/boost/math/tools/rational.hpp | 116 -
   sandbox/math_toolkit/boost/math/tools/remez.hpp | 8
   sandbox/math_toolkit/boost/math/tools/roots.hpp | 84 +
   sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 3
   sandbox/math_toolkit/libs/math/test/test_bessel_j.cpp | 2
   sandbox/math_toolkit/libs/math/test/test_bessel_y.cpp | 25
   sandbox/math_toolkit/libs/math/test/test_beta_dist.cpp | 10
   sandbox/math_toolkit/libs/math/test/test_ibeta.cpp | 19
   sandbox/math_toolkit/libs/math/test/test_ibeta_inv.cpp | 20
   sandbox/math_toolkit/libs/math/test/test_laguerre.cpp | 14
   sandbox/math_toolkit/libs/math/test/test_legendre.cpp | 60
   sandbox/math_toolkit/libs/math/test/test_rationals.cpp | 2321 ---------------------------------------
   sandbox/math_toolkit/libs/math/test/test_toms748_solve.cpp | 2
   sandbox/math_toolkit/libs/math/tools/generate_rational_test.cpp | 186 ++
   22 files changed, 954 insertions(+), 2836 deletions(-)

Modified: sandbox/math_toolkit/boost/math/special_functions/beta.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/beta.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/beta.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -175,136 +175,6 @@
 
 
 //
-// Series approximation to the incomplete beta:
-//
-template <class T>
-struct ibeta_series_t
-{
- typedef T result_type;
- ibeta_series_t(T a_, T b_, T x_, T mult) : result(mult), x(x_), apn(a_), poch(1-b_), n(1) {}
- T operator()()
- {
- T r = result / apn;
- apn += 1;
- result *= poch * x / n;
- ++n;
- poch += 1;
- return r;
- }
-private:
- T result, x, apn, poch;
- int n;
-};
-
-template <class T, class L>
-T ibeta_series(T a, T b, T x, T s0, const L&, bool normalised)
-{
- using namespace std;
-
- T result;
-
- if(normalised)
- {
- T prefix = 1;
- T c = a + b;
-
- // incomplete beta power term, combined with the Lanczos approximation:
- T agh = a + L::g() - T(0.5);
- T bgh = b + L::g() - T(0.5);
- T cgh = c + L::g() - T(0.5);
- result = L::lanczos_sum_expG_scaled(c) / (L::lanczos_sum_expG_scaled(a) * L::lanczos_sum_expG_scaled(b));
- if(a * b < bgh * 10)
- result *= exp((b - 0.5f) * boost::math::log1p(a / bgh));
- else
- result *= pow(cgh / bgh, b - 0.5f);
- result *= pow(x * cgh / agh, a);
- result *= sqrt(agh / boost::math::constants::e<T>());
- result *= prefix;
- }
- else
- {
- // Non-normalised, just compute the power:
- result = pow(x, a);
- }
- ibeta_series_t<T> s(a, b, x, result);
- boost::uintmax_t max_iter = BOOST_MATH_MAX_ITER;
- result = boost::math::tools::sum_series(s, boost::math::tools::digits<T>(), max_iter, s0);
- tools::check_series_iterations(BOOST_CURRENT_FUNCTION, max_iter);
- return result;
-}
-//
-// Incomplete Beta series again, this time without Lanczos support:
-//
-template <class T>
-T ibeta_series(T a, T b, T x, T s0, const boost::math::lanczos::undefined_lanczos&, bool normalised)
-{
- using namespace std;
-
- T result;
-
- if(normalised)
- {
- T prefix = 1;
- T c = a + b;
-
- // figure out integration limits for the gamma function:
- //T la = (std::max)(T(10), a);
- //T lb = (std::max)(T(10), b);
- //T lc = (std::max)(T(10), a+b);
- T la = a + 5;
- T lb = b + 5;
- T lc = a + b + 5;
-
- // calculate the gamma parts:
- T sa = detail::lower_gamma_series(a, la, ::boost::math::tools::digits<T>()) / a;
- sa += detail::upper_gamma_fraction(a, la, ::boost::math::tools::digits<T>());
- T sb = detail::lower_gamma_series(b, lb, ::boost::math::tools::digits<T>()) / b;
- sb += detail::upper_gamma_fraction(b, lb, ::boost::math::tools::digits<T>());
- T sc = detail::lower_gamma_series(c, lc, ::boost::math::tools::digits<T>()) / c;
- sc += detail::upper_gamma_fraction(c, lc, ::boost::math::tools::digits<T>());
-
- // and their combined power-terms:
- T b1 = (x * lc) / la;
- T b2 = lc/lb;
- T e1 = lc - la - lb;
- T lb1 = a * log(b1);
- T lb2 = b * log(b2);
-
- if((lb1 >= tools::log_max_value<T>())
- || (lb1 <= tools::log_min_value<T>())
- || (lb2 >= tools::log_max_value<T>())
- || (lb2 <= tools::log_min_value<T>())
- || (e1 >= tools::log_max_value<T>())
- || (e1 <= tools::log_min_value<T>()) )
- {
- T p = lb1 + lb2 - e1;
- result = exp(p);
- }
- else
- {
- result = pow(b1, a);
- if(a * b < lb * 10)
- result *= exp(b * boost::math::log1p(a / lb));
- else
- result *= pow(b2, b);
- result /= exp(e1);
- }
- // and combine the results:
- result /= sa * sb / sc;
- }
- else
- {
- // Non-normalised, just compute the power:
- result = pow(x, a);
- }
- ibeta_series_t<T> s(a, b, x, result);
- boost::uintmax_t max_iter = BOOST_MATH_MAX_ITER;
- result = boost::math::tools::sum_series(s, boost::math::tools::digits<T>(), max_iter, s0);
- tools::check_series_iterations(BOOST_CURRENT_FUNCTION, max_iter);
- return result;
-}
-
-//
 // Compute the leading power terms in the incomplete Beta:
 //
 // (x^a)(y^b)/Beta(a,b) when normalised, and
@@ -543,6 +413,149 @@
    return result;
 }
 //
+// Series approximation to the incomplete beta:
+//
+template <class T>
+struct ibeta_series_t
+{
+ typedef T result_type;
+ ibeta_series_t(T a_, T b_, T x_, T mult) : result(mult), x(x_), apn(a_), poch(1-b_), n(1) {}
+ T operator()()
+ {
+ T r = result / apn;
+ apn += 1;
+ result *= poch * x / n;
+ ++n;
+ poch += 1;
+ return r;
+ }
+private:
+ T result, x, apn, poch;
+ int n;
+};
+
+template <class T, class L>
+T ibeta_series(T a, T b, T x, T s0, const L&, bool normalised, T* p_derivative, T y)
+{
+ using namespace std;
+
+ T result;
+
+ BOOST_ASSERT((p_derivative == 0) || normalised);
+
+ if(normalised)
+ {
+ T c = a + b;
+
+ // incomplete beta power term, combined with the Lanczos approximation:
+ T agh = a + L::g() - T(0.5);
+ T bgh = b + L::g() - T(0.5);
+ T cgh = c + L::g() - T(0.5);
+ result = L::lanczos_sum_expG_scaled(c) / (L::lanczos_sum_expG_scaled(a) * L::lanczos_sum_expG_scaled(b));
+ if(a * b < bgh * 10)
+ result *= exp((b - 0.5f) * boost::math::log1p(a / bgh));
+ else
+ result *= pow(cgh / bgh, b - 0.5f);
+ result *= pow(x * cgh / agh, a);
+ result *= sqrt(agh / boost::math::constants::e<T>());
+
+ if(p_derivative)
+ {
+ *p_derivative = result * pow(y, b);
+ BOOST_ASSERT(*p_derivative >= 0);
+ }
+ }
+ else
+ {
+ // Non-normalised, just compute the power:
+ result = pow(x, a);
+ }
+ ibeta_series_t<T> s(a, b, x, result);
+ boost::uintmax_t max_iter = BOOST_MATH_MAX_ITER;
+ result = boost::math::tools::sum_series(s, boost::math::tools::digits<T>(), max_iter, s0);
+ tools::check_series_iterations(BOOST_CURRENT_FUNCTION, max_iter);
+ return result;
+}
+//
+// Incomplete Beta series again, this time without Lanczos support:
+//
+template <class T>
+T ibeta_series(T a, T b, T x, T s0, const boost::math::lanczos::undefined_lanczos&, bool normalised, T* p_derivative, T y)
+{
+ using namespace std;
+
+ T result;
+ BOOST_ASSERT((p_derivative == 0) || normalised);
+
+ if(normalised)
+ {
+ T prefix = 1;
+ T c = a + b;
+
+ // figure out integration limits for the gamma function:
+ //T la = (std::max)(T(10), a);
+ //T lb = (std::max)(T(10), b);
+ //T lc = (std::max)(T(10), a+b);
+ T la = a + 5;
+ T lb = b + 5;
+ T lc = a + b + 5;
+
+ // calculate the gamma parts:
+ T sa = detail::lower_gamma_series(a, la, ::boost::math::tools::digits<T>()) / a;
+ sa += detail::upper_gamma_fraction(a, la, ::boost::math::tools::digits<T>());
+ T sb = detail::lower_gamma_series(b, lb, ::boost::math::tools::digits<T>()) / b;
+ sb += detail::upper_gamma_fraction(b, lb, ::boost::math::tools::digits<T>());
+ T sc = detail::lower_gamma_series(c, lc, ::boost::math::tools::digits<T>()) / c;
+ sc += detail::upper_gamma_fraction(c, lc, ::boost::math::tools::digits<T>());
+
+ // and their combined power-terms:
+ T b1 = (x * lc) / la;
+ T b2 = lc/lb;
+ T e1 = lc - la - lb;
+ T lb1 = a * log(b1);
+ T lb2 = b * log(b2);
+
+ if((lb1 >= tools::log_max_value<T>())
+ || (lb1 <= tools::log_min_value<T>())
+ || (lb2 >= tools::log_max_value<T>())
+ || (lb2 <= tools::log_min_value<T>())
+ || (e1 >= tools::log_max_value<T>())
+ || (e1 <= tools::log_min_value<T>()) )
+ {
+ T p = lb1 + lb2 - e1;
+ result = exp(p);
+ }
+ else
+ {
+ result = pow(b1, a);
+ if(a * b < lb * 10)
+ result *= exp(b * boost::math::log1p(a / lb));
+ else
+ result *= pow(b2, b);
+ result /= exp(e1);
+ }
+ // and combine the results:
+ result /= sa * sb / sc;
+
+ if(p_derivative)
+ {
+ *p_derivative = result * pow(y, b);
+ BOOST_ASSERT(*p_derivative >= 0);
+ }
+ }
+ else
+ {
+ // Non-normalised, just compute the power:
+ result = pow(x, a);
+ }
+ ibeta_series_t<T> s(a, b, x, result);
+ boost::uintmax_t max_iter = BOOST_MATH_MAX_ITER;
+ result = boost::math::tools::sum_series(s, boost::math::tools::digits<T>(), max_iter, s0);
+ tools::check_series_iterations(BOOST_CURRENT_FUNCTION, max_iter);
+ return result;
+}
+
+//
 // Continued fraction for the incomplete beta:
 //
 template <class T>
@@ -575,10 +588,15 @@
 // Evaluate the incomplete beta via the continued fraction representation:
 //
 template <class T, class L>
-T ibeta_fraction2(T a, T b, T x, T y, const L& l, bool normalised)
+T ibeta_fraction2(T a, T b, T x, T y, const L& l, bool normalised, T* p_derivative)
 {
    using namespace std;
    T result = ibeta_power_terms(a, b, x, y, l, normalised);
+ if(p_derivative)
+ {
+ *p_derivative = result;
+ BOOST_ASSERT(*p_derivative >= 0);
+ }
    if(result == 0)
       return result;
 
@@ -590,9 +608,15 @@
 // Computes the difference between ibeta(a,b,x) and ibeta(a+k,b,x):
 //
 template <class T, class L>
-T ibeta_a_step(T a, T b, T x, T y, int k, const L& l, bool normalised)
+T ibeta_a_step(T a, T b, T x, T y, int k, const L& l, bool normalised, T* p_derivative)
 {
- T prefix = ibeta_power_terms(a, b, x, y, l, normalised)/a;
+ T prefix = ibeta_power_terms(a, b, x, y, l, normalised);
+ if(p_derivative)
+ {
+ *p_derivative = prefix;
+ BOOST_ASSERT(*p_derivative >= 0);
+ }
+ prefix /= a;
    if(prefix == 0)
       return prefix;
    T sum = 1;
@@ -800,7 +824,7 @@
 // each domain:
 //
 template <class T, class L>
-T ibeta_imp(T a, T b, T x, const L& l, bool inv, bool normalised)
+T ibeta_imp(T a, T b, T x, const L& l, bool inv, bool normalised, T* p_derivative)
 {
    using namespace std; // for ADL of std math functions.
 
@@ -808,6 +832,11 @@
    T fract;
    T y = 1 - x;
 
+ BOOST_ASSERT((p_derivative == 0) || normalised);
+
+ if(p_derivative)
+ *p_derivative = -1; // value not set.
+
    if(normalised)
    {
       // extend to a few very special cases:
@@ -825,9 +854,21 @@
       tools::domain_error<T>(BOOST_CURRENT_FUNCTION, "Parameter x outside the range [0,1] in the incomplete beta function (got x=%1%).", x);
 
    if(x == 0)
+ {
+ if(p_derivative)
+ {
+ *p_derivative = (a == 1) ? 1 : (a < 1) ? tools::max_value<T>() / 2 : tools::min_value<T>() * 2;
+ }
       return (invert ? (normalised ? 1 : beta_imp(a, b, l)) : 0);
+ }
    if(x == 1)
+ {
+ if(p_derivative)
+ {
+ *p_derivative = (b == 1) ? 1 : (b < 1) ? tools::max_value<T>() / 2 : tools::min_value<T>() * 2;
+ }
       return (invert == 0 ? (normalised ? 1 : beta_imp(a, b, l)) : 0);
+ }
 
    if((std::min)(a, b) <= 1)
    {
@@ -843,12 +884,12 @@
          if((a >= (std::min)(T(0.2), b)) || (pow(x, a) <= 0.9))
          {
             if(!invert)
- fract = ibeta_series(a, b, x, T(0), l, normalised);
+ fract = ibeta_series(a, b, x, T(0), l, normalised, p_derivative, y);
             else
             {
                fract = -(normalised ? 1 : beta_imp(a, b, l));
                invert = false;
- fract = -ibeta_series(a, b, x, fract, l, normalised);
+ fract = -ibeta_series(a, b, x, fract, l, normalised, p_derivative, y);
             }
          }
          else
@@ -859,12 +900,12 @@
             if(y >= 0.3)
             {
                if(!invert)
- fract = ibeta_series(a, b, x, T(0), l, normalised);
+ fract = ibeta_series(a, b, x, T(0), l, normalised, p_derivative, y);
                else
                {
                   fract = -(normalised ? 1 : beta_imp(a, b, l));
                   invert = false;
- fract = -ibeta_series(a, b, x, fract, l, normalised);
+ fract = -ibeta_series(a, b, x, fract, l, normalised, p_derivative, y);
                }
             }
             else
@@ -879,7 +920,7 @@
                {
                   prefix = 1;
                }
- fract = ibeta_a_step(a, b, x, y, 20, l, normalised);
+ fract = ibeta_a_step(a, b, x, y, 20, l, normalised, p_derivative);
                if(!invert)
                   fract = beta_small_b_large_a_series(a + 20, b, x, y, fract, prefix, l, normalised);
                else
@@ -897,12 +938,12 @@
          if((b <= 1) || ((x < 0.1) && (pow(b * x, a) <= 0.7)))
          {
             if(!invert)
- fract = ibeta_series(a, b, x, T(0), l, normalised);
+ fract = ibeta_series(a, b, x, T(0), l, normalised, p_derivative, y);
             else
             {
                fract = -(normalised ? 1 : beta_imp(a, b, l));
                invert = false;
- fract = -ibeta_series(a, b, x, fract, l, normalised);
+ fract = -ibeta_series(a, b, x, fract, l, normalised, p_derivative, y);
             }
          }
          else
@@ -914,12 +955,12 @@
             if(y >= 0.3)
             {
                if(!invert)
- fract = ibeta_series(a, b, x, T(0), l, normalised);
+ fract = ibeta_series(a, b, x, T(0), l, normalised, p_derivative, y);
                else
                {
                   fract = -(normalised ? 1 : beta_imp(a, b, l));
                   invert = false;
- fract = -ibeta_series(a, b, x, fract, l, normalised);
+ fract = -ibeta_series(a, b, x, fract, l, normalised, p_derivative, y);
                }
             }
             else if(a >= 15)
@@ -945,7 +986,7 @@
                {
                   prefix = 1;
                }
- fract = ibeta_a_step(a, b, x, y, 20, l, normalised);
+ fract = ibeta_a_step(a, b, x, y, 20, l, normalised, p_derivative);
                if(!invert)
                   fract = beta_small_b_large_a_series(a + 20, b, x, y, fract, prefix, l, normalised);
                else
@@ -991,12 +1032,12 @@
          else if(b * x <= 0.7)
          {
             if(!invert)
- fract = ibeta_series(a, b, x, T(0), l, normalised);
+ fract = ibeta_series(a, b, x, T(0), l, normalised, p_derivative, y);
             else
             {
                fract = -(normalised ? 1 : beta_imp(a, b, l));
                invert = false;
- fract = -ibeta_series(a, b, x, fract, l, normalised);
+ fract = -ibeta_series(a, b, x, fract, l, normalised, p_derivative, y);
             }
          }
          else if(a > 15)
@@ -1015,7 +1056,7 @@
             {
                prefix = 1;
             }
- fract = ibeta_a_step(bbar, a, y, x, n, l, normalised);
+ fract = ibeta_a_step(bbar, a, y, x, n, l, normalised, static_cast<T*>(0));
             fract = beta_small_b_large_a_series(a, bbar, x, y, fract, T(1), l, normalised);
             fract /= prefix;
          }
@@ -1031,11 +1072,11 @@
                --n;
                bbar += 1;
             }
- fract = ibeta_a_step(bbar, a, y, x, n, l, normalised);
- fract += ibeta_a_step(a, bbar, x, y, 20, l, normalised);
+ fract = ibeta_a_step(bbar, a, y, x, n, l, normalised, static_cast<T*>(0));
+ fract += ibeta_a_step(a, bbar, x, y, 20, l, normalised, static_cast<T*>(0));
             if(invert)
                fract -= (normalised ? 1 : beta_imp(a, b, l));
- //fract = ibeta_series(a+20, bbar, x, fract, l, normalised);
+ //fract = ibeta_series(a+20, bbar, x, fract, l, normalised, p_derivative, y);
             fract = beta_small_b_large_a_series(a+20, bbar, x, y, fract, T(1), l, normalised);
             if(invert)
             {
@@ -1044,15 +1085,42 @@
             }
          }
          else
- fract = ibeta_fraction2(a, b, x, y, l, normalised);
+ fract = ibeta_fraction2(a, b, x, y, l, normalised, p_derivative);
       }
       else
- fract = ibeta_fraction2(a, b, x, y, l, normalised);
+ fract = ibeta_fraction2(a, b, x, y, l, normalised, p_derivative);
+ }
+ if(p_derivative)
+ {
+ if(*p_derivative < 0)
+ {
+ *p_derivative = ibeta_power_terms(a, b, x, y, l, true);
+ }
+ T div = y * x;
+
+ if(*p_derivative != 0)
+ {
+ if((tools::max_value<T>() * div < *p_derivative))
+ {
+ // overflow, return an arbitarily large value:
+ *p_derivative = tools::max_value<T>() / 2;
+ }
+ else
+ {
+ *p_derivative /= div;
+ }
+ }
    }
    return invert ? (normalised ? 1 : beta_imp(a, b, l)) - fract : fract;
 } // template <class T, class L>T ibeta_imp(T a, T b, T x, const L& l, bool inv, bool normalised)
 
 template <class T, class L>
+inline T ibeta_imp(T a, T b, T x, const L& l, bool inv, bool normalised)
+{
+ return ibeta_imp(a, b, x, l, inv, normalised, static_cast<T*>(0));
+}
+
+template <class T, class L>
 T ibeta_derivative_imp(T a, T b, T x, const L& l)
 {
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/ibeta_inverse.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -166,35 +166,35 @@
    // Calculate e1 and put it in terms[1], see the middle of page 151:
    //
    workspace[0] = (2 * s * s - 1) / (3 * s * c);
- static const int co1[] = { -1, -5, 5 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co1[] = { -1, -5, 5 };
    workspace[1] = -tools::evaluate_even_polynomial(co1, s, 3) / (36 * sc_2);
- static const int co2[] = { 1, 21, -69, 46 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co2[] = { 1, 21, -69, 46 };
    workspace[2] = tools::evaluate_even_polynomial(co2, s, 4) / (1620 * sc_3);
- static const int co3[] = { 7, -2, 33, -62, 31 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co3[] = { 7, -2, 33, -62, 31 };
    workspace[3] = -tools::evaluate_even_polynomial(co3, s, 5) / (6480 * sc_4);
- static const int co4[] = { 25, -52, -17, 88, -115, 46 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co4[] = { 25, -52, -17, 88, -115, 46 };
    workspace[4] = tools::evaluate_even_polynomial(co4, s, 6) / (90720 * sc_5);
    terms[1] = tools::evaluate_polynomial(workspace, eta0, 5);
    //
    // Now evaluate e2 and put it in terms[2]:
    //
- static const int co5[] = { 7, 12, -78, 52 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co5[] = { 7, 12, -78, 52 };
    workspace[0] = -tools::evaluate_even_polynomial(co5, s, 4) / (405 * sc_3);
- static const int co6[] = { -7, 2, 183, -370, 185 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co6[] = { -7, 2, 183, -370, 185 };
    workspace[1] = tools::evaluate_even_polynomial(co6, s, 5) / (2592 * sc_4);
- static const int co7[] = { -533, 776, -1835, 10240, -13525, 5410 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co7[] = { -533, 776, -1835, 10240, -13525, 5410 };
    workspace[2] = -tools::evaluate_even_polynomial(co7, s, 6) / (204120 * sc_5);
- static const int co8[] = { -1579, 3747, -3372, -15821, 45588, -45213, 15071 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co8[] = { -1579, 3747, -3372, -15821, 45588, -45213, 15071 };
    workspace[3] = -tools::evaluate_even_polynomial(co8, s, 7) / (2099520 * sc_6);
    terms[2] = tools::evaluate_polynomial(workspace, eta0, 4);
    //
    // And e3, and put it in terms[3]:
    //
- static const int co9[] = {449, -1259, -769, 6686, -9260, 3704 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co9[] = {449, -1259, -769, 6686, -9260, 3704 };
    workspace[0] = tools::evaluate_even_polynomial(co9, s, 6) / (102060 * sc_5);
- static const int co10[] = { 63149, -151557, 140052, -727469, 2239932, -2251437, 750479 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co10[] = { 63149, -151557, 140052, -727469, 2239932, -2251437, 750479 };
    workspace[1] = -tools::evaluate_even_polynomial(co10, s, 7) / (20995200 * sc_6);
- static const int co11[] = { 29233, -78755, 105222, 146879, -1602610, 3195183, -2554139, 729754 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co11[] = { 29233, -78755, 105222, 146879, -1602610, 3195183, -2554139, 729754 };
    workspace[2] = tools::evaluate_even_polynomial(co11, s, 8) / (36741600 * sc_7);
    terms[3] = tools::evaluate_polynomial(workspace, eta0, 3);
    //
@@ -228,9 +228,9 @@
       workspace[0] = s * s;
       workspace[1] = s * c;
       workspace[2] = (1 - 2 * workspace[0]) / 3;
- static const int co3[] = { 1, -13, 13 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co3[] = { 1, -13, 13 };
       workspace[3] = tools::evaluate_polynomial(co3, workspace[0], 3) / (36 * s * c);
- static const int co4[] = { 1, 21, -69, 46 };
+ static const BOOST_MATH_INT_TABLE_TYPE(T, int) co4[] = { 1, 21, -69, 46 };
       workspace[4] = tools::evaluate_polynomial(co4, workspace[0], 4) / (270 * workspace[0] * c * c);
       x = tools::evaluate_polynomial(workspace, eta, 5);
 #ifdef BOOST_INSTRUMENT
@@ -415,16 +415,17 @@
       using namespace std; // ADL of std names
 
       BOOST_FPU_EXCEPTION_GUARD
- T f = ibeta_imp(a, b, x, L(), invert, true) - target;
- T f1 = invert ?
- -ibeta_power_terms(b, a, 1 - x, x, L(), true)
- : ibeta_power_terms(a, b, x, 1 - x, L(), true);
+
+ T f1;
       T y = 1 - x;
+ T f = ibeta_imp(a, b, x, L(), invert, true, &f1) - target;
+ if(invert)
+ f1 = -f1;
       if(y == 0)
          y = tools::min_value<T>() * 64;
       if(x == 0)
          x = tools::min_value<T>() * 64;
- f1 /= y * x;
+
       T f2 = f1 * (-y * a + (b - 2) * x + 1);
       if(fabs(f2) < y * x * tools::max_value<T>())
          f2 /= (y * x);
@@ -551,19 +552,23 @@
                std::swap(p, q);
                invert = !invert;
             }
- T qpb = pow(q, 1/b);
- if(qpb > 1e-3)
+ //
+ // Try and compute the easy way first:
+ //
+ T bet = 0;
+ if(b < 2)
+ bet = boost::math::beta(a, b);
+ if(bet != 0)
             {
- x = temme_method_3_ibeta_inverse(a, b, p, q);
- y = 1 - x;
+ y = pow(b * q * bet, 1/b);
+ x = 1 - y;
             }
- else
+ else
+ y = 1;
+ if(y > 1e-5)
             {
- if(qpb < tools::min_value<T>())
- y = pow(b * q * boost::math::beta(a, b), 1/b);
- else
- y = qpb * pow(b * boost::math::beta(a, b), 1/b);
- x = 1 - y;
+ x = temme_method_3_ibeta_inverse(a, b, p, q);
+ y = 1 - x;
             }
          }
       }
@@ -580,8 +585,12 @@
       // right side of the inflection point:
       //
       T fs = boost::math::ibeta(a, b, xs) - p;
- if(fs == 0)
+ if(fabs(fs) / p < tools::epsilon<T>() * 3)
+ {
+ // The result is at the point of inflection, best just return it:
+ *py = invert ? xs : 1 - xs;
          return invert ? 1-xs : xs;
+ }
       if(fs < 0)
       {
          std::swap(a, b);
@@ -699,15 +708,6 @@
             y = boost::math::tools::min_value<T>();
          x = 1 - y;
       }
- /*
- // heavyweight solution that appears to be no longer required...?
- else
- {
- y = temme_method_3_ibeta_inverse(b, a, q, p);
- if(y == 0)
- y = boost::math::tools::min_value<T>();
- x = 1 - y;
- }*/
    }
 
    //
@@ -800,11 +800,11 @@
    typedef typename lanczos::lanczos_traits<result_type>::evaluation_type evaluation_type;
 
    if(a <= 0)
- tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "The argument a to the incomplete beta function inverse must be greater than zero (got a=%1%).", a);
+ return tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "The argument a to the incomplete beta function inverse must be greater than zero (got a=%1%).", a);
    if(b <= 0)
- tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "The argument b to the incomplete beta function inverse must be greater than zero (got b=%1%).", b);
+ return tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "The argument b to the incomplete beta function inverse must be greater than zero (got b=%1%).", b);
    if((p < 0) || (p > 1))
- tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "Argument p outside the range [0,1] in the incomplete beta function inverse (got p=%1%).", p);
+ return tools::domain_error<result_type>(BOOST_CURRENT_FUNCTION, "Argument p outside the range [0,1] in the incomplete beta function inverse (got p=%1%).", p);
 
    value_type rx, ry;
 

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/igamma_inverse.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -297,30 +297,27 @@
 
       using namespace std; // For ADL of std functions.
 
- T f = !invert ? boost::math::gamma_p(a, x) : boost::math::gamma_q(a, x);
- T f1 = static_cast<T>(boost::math::detail::regularised_gamma_prefix(value_type(a), value_type(x), evaluation_type()));
+ T f, f1;
+ value_type ft;
+ f = static_cast<T>(boost::math::detail::gamma_incomplete_imp(
+ static_cast<value_type>(a),
+ static_cast<value_type>(x),
+ true, invert, evaluation_type(),
+ &ft));
+ f1 = static_cast<T>(ft);
       T f2;
- if((x < 1) && (tools::max_value<T>() * x < fabs(f1)))
+ T div = (a - x - 1) / x;
+ f2 = f1;
+ if((fabs(div) > 1) && (tools::max_value<T>() / fabs(div) < f2))
       {
          // overflow:
- f1 = tools::max_value<T>() / 2;
- f2 = -f1;
+ f2 = -tools::max_value<T>() / 2;
       }
       else
       {
- f1 /= x;
- T div = (a - x - 1) / x;
- f2 = f1;
- if((fabs(div) > 1) && (tools::max_value<T>() / fabs(div) < f2))
- {
- // overflow:
- f2 = -tools::max_value<T>() / 2;
- }
- else
- {
- f2 *= div;
- }
+ f2 *= div;
       }
+
       if(invert)
       {
          f1 = -f1;
@@ -359,7 +356,7 @@
    //
    unsigned digits = (tools::digits<T>() * 2) / 3;
    if((a < 0.125) && (fabs(gamma_p_derivative(a, guess)) > 1 / sqrt(tools::epsilon<T>())))
- digits = tools::digits<T>();
+ digits = tools::digits<T>() - 2;
    //
    // Go ahead and iterate:
    //

Modified: sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/detail/igamma_large.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -286,120 +286,120 @@
    T workspace[10];
 
    static const T C0[] = {
- -0.33333333333333333L,
- 0.083333333333333333L,
- -0.014814814814814815L,
- 0.0011574074074074074L,
- 0.0003527336860670194L,
- -0.00017875514403292181L,
- 0.39192631785224378e-4L,
- -0.21854485106799922e-5L,
- -0.185406221071516e-5L,
- 0.8296711340953086e-6L,
- -0.17665952736826079e-6L,
- 0.67078535434014986e-8L,
- 0.10261809784240308e-7L,
- -0.43820360184533532e-8L,
- 0.91476995822367902e-9L,
+ static_cast<T>(-0.33333333333333333L),
+ static_cast<T>(0.083333333333333333L),
+ static_cast<T>(-0.014814814814814815L),
+ static_cast<T>(0.0011574074074074074L),
+ static_cast<T>(0.0003527336860670194L),
+ static_cast<T>(-0.00017875514403292181L),
+ static_cast<T>(0.39192631785224378e-4L),
+ static_cast<T>(-0.21854485106799922e-5L),
+ static_cast<T>(-0.185406221071516e-5L),
+ static_cast<T>(0.8296711340953086e-6L),
+ static_cast<T>(-0.17665952736826079e-6L),
+ static_cast<T>(0.67078535434014986e-8L),
+ static_cast<T>(0.10261809784240308e-7L),
+ static_cast<T>(-0.43820360184533532e-8L),
+ static_cast<T>(0.91476995822367902e-9L),
    };
    workspace[0] = tools::evaluate_polynomial(C0, z);
 
    static const T C1[] = {
- -0.0018518518518518519L,
- -0.0034722222222222222L,
- 0.0026455026455026455L,
- -0.00099022633744855967L,
- 0.00020576131687242798L,
- -0.40187757201646091e-6L,
- -0.18098550334489978e-4L,
- 0.76491609160811101e-5L,
- -0.16120900894563446e-5L,
- 0.46471278028074343e-8L,
- 0.1378633446915721e-6L,
- -0.5752545603517705e-7L,
- 0.11951628599778147e-7L,
+ static_cast<T>(-0.0018518518518518519L),
+ static_cast<T>(-0.0034722222222222222L),
+ static_cast<T>(0.0026455026455026455L),
+ static_cast<T>(-0.00099022633744855967L),
+ static_cast<T>(0.00020576131687242798L),
+ static_cast<T>(-0.40187757201646091e-6L),
+ static_cast<T>(-0.18098550334489978e-4L),
+ static_cast<T>(0.76491609160811101e-5L),
+ static_cast<T>(-0.16120900894563446e-5L),
+ static_cast<T>(0.46471278028074343e-8L),
+ static_cast<T>(0.1378633446915721e-6L),
+ static_cast<T>(-0.5752545603517705e-7L),
+ static_cast<T>(0.11951628599778147e-7L),
    };
    workspace[1] = tools::evaluate_polynomial(C1, z);
 
    static const T C2[] = {
- 0.0041335978835978836L,
- -0.0026813271604938272L,
- 0.00077160493827160494L,
- 0.20093878600823045e-5L,
- -0.00010736653226365161L,
- 0.52923448829120125e-4L,
- -0.12760635188618728e-4L,
- 0.34235787340961381e-7L,
- 0.13721957309062933e-5L,
- -0.6298992138380055e-6L,
- 0.14280614206064242e-6L,
+ static_cast<T>(0.0041335978835978836L),
+ static_cast<T>(-0.0026813271604938272L),
+ static_cast<T>(0.00077160493827160494L),
+ static_cast<T>(0.20093878600823045e-5L),
+ static_cast<T>(-0.00010736653226365161L),
+ static_cast<T>(0.52923448829120125e-4L),
+ static_cast<T>(-0.12760635188618728e-4L),
+ static_cast<T>(0.34235787340961381e-7L),
+ static_cast<T>(0.13721957309062933e-5L),
+ static_cast<T>(-0.6298992138380055e-6L),
+ static_cast<T>(0.14280614206064242e-6L),
    };
    workspace[2] = tools::evaluate_polynomial(C2, z);
 
    static const T C3[] = {
- 0.00064943415637860082L,
- 0.00022947209362139918L,
- -0.00046918949439525571L,
- 0.00026772063206283885L,
- -0.75618016718839764e-4L,
- -0.23965051138672967e-6L,
- 0.11082654115347302e-4L,
- -0.56749528269915966e-5L,
- 0.14230900732435884e-5L,
+ static_cast<T>(0.00064943415637860082L),
+ static_cast<T>(0.00022947209362139918L),
+ static_cast<T>(-0.00046918949439525571L),
+ static_cast<T>(0.00026772063206283885L),
+ static_cast<T>(-0.75618016718839764e-4L),
+ static_cast<T>(-0.23965051138672967e-6L),
+ static_cast<T>(0.11082654115347302e-4L),
+ static_cast<T>(-0.56749528269915966e-5L),
+ static_cast<T>(0.14230900732435884e-5L),
    };
    workspace[3] = tools::evaluate_polynomial(C3, z);
 
    static const T C4[] = {
- -0.0008618882909167117L,
- 0.00078403922172006663L,
- -0.00029907248030319018L,
- -0.14638452578843418e-5L,
- 0.66414982154651222e-4L,
- -0.39683650471794347e-4L,
- 0.11375726970678419e-4L,
+ static_cast<T>(-0.0008618882909167117L),
+ static_cast<T>(0.00078403922172006663L),
+ static_cast<T>(-0.00029907248030319018L),
+ static_cast<T>(-0.14638452578843418e-5L),
+ static_cast<T>(0.66414982154651222e-4L),
+ static_cast<T>(-0.39683650471794347e-4L),
+ static_cast<T>(0.11375726970678419e-4L),
    };
    workspace[4] = tools::evaluate_polynomial(C4, z);
 
    static const T C5[] = {
- -0.00033679855336635815L,
- -0.69728137583658578e-4L,
- 0.00027727532449593921L,
- -0.00019932570516188848L,
- 0.67977804779372078e-4L,
- 0.1419062920643967e-6L,
- -0.13594048189768693e-4L,
- 0.80184702563342015e-5L,
- -0.22914811765080952e-5L,
+ static_cast<T>(-0.00033679855336635815L),
+ static_cast<T>(-0.69728137583658578e-4L),
+ static_cast<T>(0.00027727532449593921L),
+ static_cast<T>(-0.00019932570516188848L),
+ static_cast<T>(0.67977804779372078e-4L),
+ static_cast<T>(0.1419062920643967e-6L),
+ static_cast<T>(-0.13594048189768693e-4L),
+ static_cast<T>(0.80184702563342015e-5L),
+ static_cast<T>(-0.22914811765080952e-5L),
    };
    workspace[5] = tools::evaluate_polynomial(C5, z);
 
    static const T C6[] = {
- 0.00053130793646399222L,
- -0.00059216643735369388L,
- 0.00027087820967180448L,
- 0.79023532326603279e-6L,
- -0.81539693675619688e-4L,
- 0.56116827531062497e-4L,
- -0.18329116582843376e-4L,
+ static_cast<T>(0.00053130793646399222L),
+ static_cast<T>(-0.00059216643735369388L),
+ static_cast<T>(0.00027087820967180448L),
+ static_cast<T>(0.79023532326603279e-6L),
+ static_cast<T>(-0.81539693675619688e-4L),
+ static_cast<T>(0.56116827531062497e-4L),
+ static_cast<T>(-0.18329116582843376e-4L),
    };
    workspace[6] = tools::evaluate_polynomial(C6, z);
 
    static const T C7[] = {
- 0.00034436760689237767L,
- 0.51717909082605922e-4L,
- -0.00033493161081142236L,
- 0.0002812695154763237L,
- -0.00010976582244684731L,
+ static_cast<T>(0.00034436760689237767L),
+ static_cast<T>(0.51717909082605922e-4L),
+ static_cast<T>(-0.00033493161081142236L),
+ static_cast<T>(0.0002812695154763237L),
+ static_cast<T>(-0.00010976582244684731L),
    };
    workspace[7] = tools::evaluate_polynomial(C7, z);
 
    static const T C8[] = {
- -0.00065262391859530942L,
- 0.00083949872067208728L,
- -0.00043829709854172101L,
+ static_cast<T>(-0.00065262391859530942L),
+ static_cast<T>(0.00083949872067208728L),
+ static_cast<T>(-0.00043829709854172101L),
    };
    workspace[8] = tools::evaluate_polynomial(C8, z);
- workspace[9] = -0.00059676129019274625L;
+ workspace[9] = static_cast<T>(-0.00059676129019274625L);
 
    T result = tools::evaluate_polynomial(workspace, 1/a);
    result *= exp(-y) / sqrt(2 * constants::pi<T>() * a);
@@ -428,29 +428,29 @@
    T workspace[3];
 
    static const T C0[] = {
- -0.333333333L,
- 0.0833333333L,
- -0.0148148148L,
- 0.00115740741L,
- 0.000352733686L,
- -0.000178755144L,
- 0.391926318e-4L,
+ static_cast<T>(-0.333333333L),
+ static_cast<T>(0.0833333333L),
+ static_cast<T>(-0.0148148148L),
+ static_cast<T>(0.00115740741L),
+ static_cast<T>(0.000352733686L),
+ static_cast<T>(-0.000178755144L),
+ static_cast<T>(0.391926318e-4L),
    };
    workspace[0] = tools::evaluate_polynomial(C0, z);
 
    static const T C1[] = {
- -0.00185185185L,
- -0.00347222222L,
- 0.00264550265L,
- -0.000990226337L,
- 0.000205761317L,
+ static_cast<T>(-0.00185185185L),
+ static_cast<T>(-0.00347222222L),
+ static_cast<T>(0.00264550265L),
+ static_cast<T>(-0.000990226337L),
+ static_cast<T>(0.000205761317L),
    };
    workspace[1] = tools::evaluate_polynomial(C1, z);
 
    static const T C2[] = {
- 0.00413359788L,
- -0.00268132716L,
- 0.000771604938L,
+ static_cast<T>(0.00413359788L),
+ static_cast<T>(-0.00268132716L),
+ static_cast<T>(0.000771604938L),
    };
    workspace[2] = tools::evaluate_polynomial(C2, z);
 

Modified: sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/fpclassify.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -46,6 +46,10 @@
 # define BOOST_FPCLASSIFY_PREFIX
 #endif
 
+#ifdef __MINGW32__
+# undef BOOST_HAS_FPCLASSIFY
+#endif
+
 #endif
 
 namespace boost{ namespace math{

Modified: sandbox/math_toolkit/boost/math/special_functions/gamma.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/gamma.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/gamma.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -158,7 +158,7 @@
       if(z * log(z) > tools::log_max_value<T>())
       {
          // we're going to overflow unless this is done with care:
- T zgh = (z + L::g() - boost::math::constants::half<T>());
+ T zgh = (z + static_cast<T>(L::g()) - boost::math::constants::half<T>());
          if(log(zgh) * z / 2 > tools::log_max_value<T>())
             return tools::overflow_error<T>(BOOST_CURRENT_FUNCTION, "Result of tgamma is too large to represent.");
          T hp = pow(zgh, (z / 2) - T(0.25));
@@ -169,7 +169,7 @@
       }
       else
       {
- T zgh = (z + L::g() - boost::math::constants::half<T>());
+ T zgh = (z + static_cast<T>(L::g()) - boost::math::constants::half<T>());
          result *= pow(zgh, z - boost::math::constants::half<T>()) / exp(zgh);
       }
    }
@@ -231,23 +231,23 @@
       // Maximum Deviation Found (approximation error): 5.900e-24
       //
       static const T P[] = {
- -0.180355685678449379109e-1L,
- 0.25126649619989678683e-1L,
- 0.494103151567532234274e-1L,
- 0.172491608709613993966e-1L,
- -0.259453563205438108893e-3L,
- -0.541009869215204396339e-3L,
- -0.324588649825948492091e-4L
+ static_cast<T>(-0.180355685678449379109e-1L),
+ static_cast<T>(0.25126649619989678683e-1L),
+ static_cast<T>(0.494103151567532234274e-1L),
+ static_cast<T>(0.172491608709613993966e-1L),
+ static_cast<T>(-0.259453563205438108893e-3L),
+ static_cast<T>(-0.541009869215204396339e-3L),
+ static_cast<T>(-0.324588649825948492091e-4L)
       };
       static const T Q[] = {
- 0.1e1,
- 0.196202987197795200688e1L,
- 0.148019669424231326694e1L,
- 0.541391432071720958364e0L,
- 0.988504251128010129477e-1L,
- 0.82130967464889339326e-2L,
- 0.224936291922115757597e-3L,
- -0.223352763208617092964e-6L
+ static_cast<T>(0.1e1),
+ static_cast<T>(0.196202987197795200688e1L),
+ static_cast<T>(0.148019669424231326694e1L),
+ static_cast<T>(0.541391432071720958364e0L),
+ static_cast<T>(0.988504251128010129477e-1L),
+ static_cast<T>(0.82130967464889339326e-2L),
+ static_cast<T>(0.224936291922115757597e-3L),
+ static_cast<T>(-0.223352763208617092964e-6L)
       };
 
       static const float Y = 0.158963680267333984375e0f;
@@ -298,22 +298,22 @@
          static const float Y = 0.52815341949462890625f;
 
          static const T P[] = {
- 0.490622454069039543534e-1L,
- -0.969117530159521214579e-1L,
- -0.414983358359495381969e0L,
- -0.406567124211938417342e0L,
- -0.158413586390692192217e0L,
- -0.240149820648571559892e-1L,
- -0.100346687696279557415e-2L
+ static_cast<T>(0.490622454069039543534e-1L),
+ static_cast<T>(-0.969117530159521214579e-1L),
+ static_cast<T>(-0.414983358359495381969e0L),
+ static_cast<T>(-0.406567124211938417342e0L),
+ static_cast<T>(-0.158413586390692192217e0L),
+ static_cast<T>(-0.240149820648571559892e-1L),
+ static_cast<T>(-0.100346687696279557415e-2L)
          };
          static const T Q[] = {
- 0.1e1L,
- 0.302349829846463038743e1L,
- 0.348739585360723852576e1L,
- 0.191415588274426679201e1L,
- 0.507137738614363510846e0L,
- 0.577039722690451849648e-1L,
- 0.195768102601107189171e-2L
+ static_cast<T>(0.1e1L),
+ static_cast<T>(0.302349829846463038743e1L),
+ static_cast<T>(0.348739585360723852576e1L),
+ static_cast<T>(0.191415588274426679201e1L),
+ static_cast<T>(0.507137738614363510846e0L),
+ static_cast<T>(0.577039722690451849648e-1L),
+ static_cast<T>(0.195768102601107189171e-2L)
          };
 
          T r = tools::evaluate_polynomial(P, zm1) / tools::evaluate_polynomial(Q, zm1);
@@ -343,21 +343,21 @@
          static const float Y = 0.452017307281494140625f;
 
          static const T P[] = {
- -0.292329721830270012337e-1L,
- 0.144216267757192309184e0L,
- -0.142440390738631274135e0L,
- 0.542809694055053558157e-1L,
- -0.850535976868336437746e-2L,
- 0.431171342679297331241e-3L
+ static_cast<T>(-0.292329721830270012337e-1L),
+ static_cast<T>(0.144216267757192309184e0L),
+ static_cast<T>(-0.142440390738631274135e0L),
+ static_cast<T>(0.542809694055053558157e-1L),
+ static_cast<T>(-0.850535976868336437746e-2L),
+ static_cast<T>(0.431171342679297331241e-3L)
          };
          static const T Q[] = {
- 0.1e1,
- -0.150169356054485044494e1L,
- 0.846973248876495016101e0L,
- -0.220095151814995745555e0L,
- 0.25582797155975869989e-1L,
- -0.100666795539143372762e-2L,
- -0.827193521891290553639e-6L
+ static_cast<T>(0.1e1),
+ static_cast<T>(-0.150169356054485044494e1L),
+ static_cast<T>(0.846973248876495016101e0L),
+ static_cast<T>(-0.220095151814995745555e0L),
+ static_cast<T>(0.25582797155975869989e-1L),
+ static_cast<T>(-0.100666795539143372762e-2L),
+ static_cast<T>(-0.827193521891290553639e-6L)
          };
          T r = zm2 * zm1;
          T R = tools::evaluate_polynomial(P, -zm2) / tools::evaluate_polynomial(Q, -zm2);
@@ -712,7 +712,7 @@
    else
    {
       // regular evaluation:
- T zgh = (z + L::g() - boost::math::constants::half<T>());
+ T zgh = static_cast<T>(z + L::g() - boost::math::constants::half<T>());
       T l = L::lanczos_sum_expG_scaled(z);
       result = log(zgh) - 1;
       result *= z - 0.5f;
@@ -1058,9 +1058,9 @@
 T regularised_gamma_prefix(T a, T z, const L& l)
 {
    using namespace std;
- T agh = a + L::g() - T(0.5);
+ T agh = a + static_cast<T>(L::g()) - T(0.5);
    T prefix;
- T d = ((z - a) - L::g() + T(0.5)) / agh;
+ T d = ((z - a) - static_cast<T>(L::g()) + T(0.5)) / agh;
 
    if(a < 1)
    {
@@ -1088,7 +1088,7 @@
    else if((fabs(d*d*a) <= 100) && (a > 150))
    {
       // special case for large a and a ~ z.
- prefix = a * log1pmx(d) + z * (0.5 - L::g()) / agh;
+ prefix = a * log1pmx(d) + z * static_cast<T>(0.5 - L::g()) / agh;
       prefix = exp(prefix);
    }
    else
@@ -1231,7 +1231,7 @@
 // Upper gamma fraction for half integer a:
 //
 template <class T>
-T finite_half_gamma_q(T a, T x)
+T finite_half_gamma_q(T a, T x, T* p_derivative)
 {
    //
    // Calculates normalised Q when a is a half-integer:
@@ -1252,6 +1252,15 @@
          sum += term;
       }
       e += sum;
+ if(p_derivative)
+ {
+ *p_derivative = 0;
+ }
+ }
+ else if(p_derivative)
+ {
+ // We'll be dividing by x later, so calculate derivative * x:
+ *p_derivative = sqrt(x) * exp(-x) / constants::root_pi<T>();
    }
    return e;
 }
@@ -1259,7 +1268,8 @@
 // Main incomplete gamma entry point, handles all four incomplete gamma's:
 //
 template <class T, class L>
-T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, const L& l)
+T gamma_incomplete_imp(T a, T x, bool normalised, bool invert,
+ const L& l, T* p_derivative)
 {
    if(a <= 0)
       tools::domain_error<T>(BOOST_CURRENT_FUNCTION, "Argument a to the incomplete gamma function must be greater than zero (got a=%1%).", a);
@@ -1270,6 +1280,8 @@
 
    T result;
 
+ BOOST_ASSERT((p_derivative == 0) || (normalised == true));
+
    bool is_int = floor(a) == a;
    bool is_half_int = (floor(2 * a) == 2 * a) && !is_int;
    bool is_small_a = (a < 30) && (a <= x + 1);
@@ -1281,14 +1293,19 @@
       result = finite_gamma_q(a, x);
       if(normalised == false)
          result *= gamma_imp(a, l);
+ // TODO: calculate derivative inside sum:
+ if(p_derivative)
+ *p_derivative = regularised_gamma_prefix(a, x, l);
    }
    else if(is_half_int && is_small_a && (x > 0.2))
    {
       // calculate Q via finite sum for half integer a:
       invert = !invert;
- result = finite_half_gamma_q(a, x);
+ result = finite_half_gamma_q(a, x, p_derivative);
       if(normalised == false)
          result *= gamma_imp(a, l);
+ if(p_derivative && (*p_derivative == 0))
+ *p_derivative = regularised_gamma_prefix(a, x, l);
    }
    else if(x < 0.5)
    {
@@ -1299,6 +1316,8 @@
       {
          // Compute P:
          result = normalised ? regularised_gamma_prefix(a, x, l) : full_igamma_prefix(a, x);
+ if(p_derivative)
+ *p_derivative = result;
          if(result != 0)
             result *= detail::lower_gamma_series(a, x, boost::math::tools::digits<T>()) / a;
       }
@@ -1309,6 +1328,8 @@
          result = tgamma_small_upper_part(a, x, l);
          if(normalised)
             result /= gamma_imp(a, l);
+ if(p_derivative)
+ *p_derivative = regularised_gamma_prefix(a, x, l);
       }
    }
    else if(x < 1.1)
@@ -1320,6 +1341,8 @@
       {
          // Compute P:
          result = normalised ? regularised_gamma_prefix(a, x, l) : full_igamma_prefix(a, x);
+ if(p_derivative)
+ *p_derivative = result;
          if(result != 0)
             result *= detail::lower_gamma_series(a, x, boost::math::tools::digits<T>()) / a;
       }
@@ -1330,6 +1353,8 @@
          result = tgamma_small_upper_part(a, x, l);
          if(normalised)
             result /= gamma_imp(a, l);
+ if(p_derivative)
+ *p_derivative = regularised_gamma_prefix(a, x, l);
       }
    }
    else
@@ -1394,6 +1419,8 @@
          result = igamma_temme_large(a, x, static_cast<tag_type const*>(0));
          if(x >= a)
             invert = !invert;
+ if(p_derivative)
+ *p_derivative = regularised_gamma_prefix(a, x, l);
       }
       else
       {
@@ -1403,6 +1430,8 @@
          // Changeover here occurs at P ~ Q ~ 0.5
          //
          result = normalised ? regularised_gamma_prefix(a, x, l) : full_igamma_prefix(a, x);
+ if(p_derivative)
+ *p_derivative = result;
          if(x < a)
          {
             // Compute P:
@@ -1424,9 +1453,29 @@
       T gam = normalised ? 1 : gamma_imp(a, l);
       result = gam - result;
    }
+ if(p_derivative)
+ {
+ //
+ // Need to convert prefix term to derivative:
+ //
+ if((x < 1) && (tools::max_value<T>() * x < *p_derivative))
+ {
+ // overflow, just return an arbitrarily large value:
+ *p_derivative = tools::max_value<T>() / 2;
+ }
+
+ *p_derivative /= x;
+ }
 
    return result;
 }
+
+template <class T, class L>
+inline T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, const L& l)
+{
+ return gamma_incomplete_imp(a, x, normalised, invert, l, static_cast<T*>(0));
+}
+
 //
 // Ratios of two gamma functions:
 //

Modified: sandbox/math_toolkit/boost/math/special_functions/lanczos.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/lanczos.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/lanczos.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -45,7 +45,7 @@
          static_cast<T>(63.99951844938187085666201263218840287667L),
          static_cast<T>(2.506628274631006311133031631822390264407L)
       };
- static const boost::uint16_t denom[6] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint16_t) denom[6] = {
          static_cast<boost::uint16_t>(0u),
          static_cast<boost::uint16_t>(24u),
          static_cast<boost::uint16_t>(50u),
@@ -67,7 +67,7 @@
          static_cast<T>(0.2412010548258800231126240760264822486599L),
          static_cast<T>(0.009446967704539249494420221613134244048319L)
       };
- static const boost::uint16_t denom[6] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint16_t) denom[6] = {
          static_cast<boost::uint16_t>(0u),
          static_cast<boost::uint16_t>(24u),
          static_cast<boost::uint16_t>(50u),
@@ -142,7 +142,7 @@
          static_cast<T>(261.6140441641668190791708576058805625502L),
          static_cast<T>(2.506628274631000502415573855452633787834L)
       };
- static const boost::uint32_t denom[11] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[11] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(362880u),
          static_cast<boost::uint32_t>(1026576u),
@@ -174,7 +174,7 @@
          static_cast<T>(0.004826466289237661857584712046231435101741L),
          static_cast<T>(0.4624429436045378766270459638520555557321e-4L)
       };
- static const boost::uint32_t denom[11] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[11] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(362880u),
          static_cast<boost::uint32_t>(1026576u),
@@ -266,7 +266,7 @@
          static_cast<T>(381.8801248632926870394389468349331394196L),
          static_cast<T>(2.506628274631000502415763426076722427007L)
       };
- static const boost::uint32_t denom[13] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[13] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(39916800u),
          static_cast<boost::uint32_t>(120543840u),
@@ -302,7 +302,7 @@
          static_cast<T>(0.0007469903808915448316510079585999893674101L),
          static_cast<T>(0.4903180573459871862552197089738373164184e-5L)
       };
- static const boost::uint32_t denom[13] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[13] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(39916800u),
          static_cast<boost::uint32_t>(120543840u),
@@ -409,7 +409,7 @@
          static_cast<T>(1167.501919472435718934219997431551246996L),
          static_cast<T>(2.50662827463100050241576528481104525333L)
       };
- static const boost::uint64_t denom[22] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint64_t) denom[22] = {
          (0uLL),
          (2432902008176640000uLL),
          (8752948036761600000uLL),
@@ -463,7 +463,7 @@
          static_cast<T>(0.1753839324538447655939518484052327068859e-6L),
          static_cast<T>(0.3765495513732730583386223384116545391759e-9L)
       };
- static const boost::uint64_t denom[22] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint64_t) denom[22] = {
          (0uLL),
          (2432902008176640000uLL),
          (8752948036761600000uLL),
@@ -581,7 +581,7 @@
          static_cast<T>(27.5192015197455403062503721613097825345L),
          static_cast<T>(2.50662858515256974113978724717473206342L)
       };
- static const boost::uint16_t denom[6] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint16_t) denom[6] = {
          static_cast<boost::uint16_t>(0u),
          static_cast<boost::uint16_t>(24u),
          static_cast<boost::uint16_t>(50u),
@@ -603,7 +603,7 @@
          static_cast<T>(6.595765571169314946316366571954421695196L),
          static_cast<T>(0.6007854010515290065101128585795542383721L)
       };
- static const boost::uint16_t denom[6] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint16_t) denom[6] = {
          static_cast<boost::uint16_t>(0u),
          static_cast<boost::uint16_t>(24u),
          static_cast<boost::uint16_t>(50u),
@@ -680,7 +680,7 @@
          static_cast<T>(210.8242777515793458725097339207133627117L),
          static_cast<T>(2.506628274631000270164908177133837338626L)
       };
- static const boost::uint32_t denom[13] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[13] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(39916800u),
          static_cast<boost::uint32_t>(120543840u),
@@ -716,7 +716,7 @@
          static_cast<T>(0.5098416655656676188125178644804694509993L),
          static_cast<T>(0.006061842346248906525783753964555936883222L)
       };
- static const boost::uint32_t denom[13] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint32_t) denom[13] = {
          static_cast<boost::uint32_t>(0u),
          static_cast<boost::uint32_t>(39916800u),
          static_cast<boost::uint32_t>(120543840u),
@@ -818,7 +818,7 @@
          static_cast<T>(488.0063567520005730476791712814838113252L),
          static_cast<T>(2.50662827463100050241576877135758834683L)
       };
- static const boost::uint64_t denom[17] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint64_t) denom[17] = {
          (0uLL),
          (1307674368000uLL),
          (4339163001600uLL),
@@ -862,7 +862,7 @@
          static_cast<T>(0.002393749522058449186690627996063983095463L),
          static_cast<T>(0.1229541408909435212800785616808830746135e-4L)
       };
- static const boost::uint64_t denom[17] = {
+ static const BOOST_MATH_INT_TABLE_TYPE(T, boost::uint64_t) denom[17] = {
          (0uLL),
          (1307674368000uLL),
          (4339163001600uLL),
@@ -1197,9 +1197,6 @@
 template<>
 struct lanczos_traits<float>
 {
- //typedef boost::mpl::if_c<
- // BOOST_MATH_DBL_DIGITS >= 40,
- //double, float>::type value_type;
    typedef boost::math::tools::evaluation<float>::type value_type;
    typedef boost::mpl::if_c<
       BOOST_MATH_DBL_DIGITS >= 40,
@@ -1210,6 +1207,20 @@
 struct lanczos_traits<double>
 {
    typedef boost::math::tools::evaluation<double>::type value_type;
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ typedef boost::mpl::if_c<
+ BOOST_MATH_DBL_DIGITS >= 100,
+ lanczos13,
+ boost::mpl::if_c<
+ BOOST_MATH_DBL_DIGITS >= 64,
+ lanczos17m64,
+ boost::mpl::if_c<
+ BOOST_MATH_DBL_DIGITS >= 53,
+ lanczos13m53,
+ lanczos6m24>::type
+ >::type
+ >::type evaluation_type;
+#else
    typedef boost::mpl::if_c<
       BOOST_MATH_LDBL_DIGITS >= 100,
       lanczos13,
@@ -1222,6 +1233,7 @@
             lanczos6m24>::type
>::type
>::type evaluation_type;
+#endif
 };
 
 template<>

Modified: sandbox/math_toolkit/boost/math/tools/config.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/config.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/config.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -3,11 +3,49 @@
 
 #include <boost/math/tools/error_handling.hpp>
 #include <boost/cstdint.hpp> // for boost::uintmax_t
+#include <boost/config.hpp>
 
 #define BOOST_MATH_MAX_ITER 1000000
 
 #if defined(__CYGWIN__) || defined(__FreeBSD__)
-#define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#endif
+//
+// Tune performance options for specific compilers:
+//
+#ifdef BOOST_MSVC
+# define BOOST_MATH_POLY_METHOD 3
+# define BOOST_MATH_RATIONAL_METHOD 3
+#elif defined(BOOST_INTEL)
+# define BOOST_MATH_POLY_METHOD 2
+# define BOOST_MATH_RATIONAL_METHOD 0
+#elif defined(__GNUC__)
+# define BOOST_MATH_POLY_METHOD 3
+# define BOOST_MATH_RATIONAL_METHOD 3
+# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
+#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
 
 namespace boost{ namespace math{
@@ -75,3 +113,5 @@
 #endif
 
 #endif // BOOST_MATH_TOOLS_CONFIG_HPP
+
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_2.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_2.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_20.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_20.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_3.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_3.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_4.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_4.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_5.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_5.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_6.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_6.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_7.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_7.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_8.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_8.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_9.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner1_9.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_2.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_2.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_20.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_20.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_3.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_3.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_4.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_4.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_5.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_5.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_6.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_6.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_7.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_7.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_8.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_8.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_9.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner2_9.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_2.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_2.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_20.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_20.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_3.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_3.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_4.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_4.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_5.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_5.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_6.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_6.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_7.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_7.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_8.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_8.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_9.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/polynomial_horner3_9.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_2.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_2.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_20.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_20.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_3.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_3.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_4.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_4.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_5.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_5.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_6.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_6.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_7.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_7.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_8.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_8.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_9.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner1_9.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_2.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_2.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_20.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_20.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_3.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_3.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_4.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_4.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_5.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_5.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_6.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_6.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_7.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_7.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_8.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_8.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_9.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner2_9.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_10.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_10.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_11.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_11.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_12.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_12.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_13.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_13.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -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
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_14.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_14.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,788 @@
+// (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;
+ 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]);
+ }
+}
+
+template <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;
+ V t[4];
+ t[0] = a[13] * x2 + a[11];
+ t[1] = a[12] * x2 + a[10];
+ t[2] = b[13] * x2 + b[11];
+ t[3] = b[12] * x2 + b[10];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z;
+ t[2] *= z;
+ return (t[0] + t[1]) / (t[2] + t[3]);
+ }
+}
+
+
+}}}} // namespaces
+
+#endif // include guard
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_15.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_15.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,906 @@
+// (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;
+ 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]);
+ }
+}
+
+template <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;
+ V t[4];
+ t[0] = a[13] * x2 + a[11];
+ t[1] = a[12] * x2 + a[10];
+ t[2] = b[13] * x2 + b[11];
+ t[3] = b[12] * x2 + b[10];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ 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_<15>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[14] * x2 + a[12];
+ t[1] = a[13] * x2 + a[11];
+ t[2] = b[14] * x2 + b[12];
+ t[3] = b[13] * x2 + b[11];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[2] += static_cast<V>(b[14]);
+ t[1] *= z;
+ t[3] *= z;
+ return (t[0] + t[1]) / (t[2] + t[3]);
+ }
+}
+
+
+}}}} // namespaces
+
+#endif // include guard
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_16.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_16.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,1032 @@
+// (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;
+ 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]);
+ }
+}
+
+template <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;
+ V t[4];
+ t[0] = a[13] * x2 + a[11];
+ t[1] = a[12] * x2 + a[10];
+ t[2] = b[13] * x2 + b[11];
+ t[3] = b[12] * x2 + b[10];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ 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_<15>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[14] * x2 + a[12];
+ t[1] = a[13] * x2 + a[11];
+ t[2] = b[14] * x2 + b[12];
+ t[3] = b[13] * x2 + b[11];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[2] += static_cast<V>(b[14]);
+ 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_<16>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[15] * x2 + a[13];
+ t[1] = a[14] * x2 + a[12];
+ t[2] = b[15] * x2 + b[13];
+ t[3] = b[14] * x2 + b[12];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[11]);
+ t[1] += static_cast<V>(a[10]);
+ t[2] += static_cast<V>(b[11]);
+ t[3] += static_cast<V>(b[10]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ t[0] *= z;
+ t[2] *= z;
+ return (t[0] + t[1]) / (t[2] + t[3]);
+ }
+}
+
+
+}}}} // namespaces
+
+#endif // include guard
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_17.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_17.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,1166 @@
+// (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;
+ 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]);
+ }
+}
+
+template <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;
+ V t[4];
+ t[0] = a[13] * x2 + a[11];
+ t[1] = a[12] * x2 + a[10];
+ t[2] = b[13] * x2 + b[11];
+ t[3] = b[12] * x2 + b[10];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ 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_<15>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[14] * x2 + a[12];
+ t[1] = a[13] * x2 + a[11];
+ t[2] = b[14] * x2 + b[12];
+ t[3] = b[13] * x2 + b[11];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[2] += static_cast<V>(b[14]);
+ 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_<16>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[15] * x2 + a[13];
+ t[1] = a[14] * x2 + a[12];
+ t[2] = b[15] * x2 + b[13];
+ t[3] = b[14] * x2 + b[12];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[11]);
+ t[1] += static_cast<V>(a[10]);
+ t[2] += static_cast<V>(b[11]);
+ t[3] += static_cast<V>(b[10]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ 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_<17>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[16] * x2 + a[14];
+ t[1] = a[15] * x2 + a[13];
+ t[2] = b[16] * x2 + b[14];
+ t[3] = b[15] * x2 + b[13];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[11]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[11]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[16]);
+ t[2] += static_cast<V>(b[16]);
+ t[1] *= z;
+ t[3] *= z;
+ return (t[0] + t[1]) / (t[2] + t[3]);
+ }
+}
+
+
+}}}} // namespaces
+
+#endif // include guard
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_18.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_18.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,1308 @@
+// (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;
+ 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]);
+ }
+}
+
+template <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;
+ V t[4];
+ t[0] = a[13] * x2 + a[11];
+ t[1] = a[12] * x2 + a[10];
+ t[2] = b[13] * x2 + b[11];
+ t[3] = b[12] * x2 + b[10];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ 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_<15>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[14] * x2 + a[12];
+ t[1] = a[13] * x2 + a[11];
+ t[2] = b[14] * x2 + b[12];
+ t[3] = b[13] * x2 + b[11];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[2] += static_cast<V>(b[14]);
+ 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_<16>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[15] * x2 + a[13];
+ t[1] = a[14] * x2 + a[12];
+ t[2] = b[15] * x2 + b[13];
+ t[3] = b[14] * x2 + b[12];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[11]);
+ t[1] += static_cast<V>(a[10]);
+ t[2] += static_cast<V>(b[11]);
+ t[3] += static_cast<V>(b[10]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ 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_<17>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[16] * x2 + a[14];
+ t[1] = a[15] * x2 + a[13];
+ t[2] = b[16] * x2 + b[14];
+ t[3] = b[15] * x2 + b[13];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[11]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[11]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[10]);
+ t[1] += static_cast<V>(a[9]);
+ t[2] += static_cast<V>(b[10]);
+ t[3] += static_cast<V>(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[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ t[0] *= z2;
+ t[2] *= z2;
+ t[0] += static_cast<V>(a[16]);
+ t[2] += static_cast<V>(b[16]);
+ 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_<18>*)
+{
+ if(x <= 1)
+ {
+ V x2 = x * x;
+ V t[4];
+ t[0] = a[17] * x2 + a[15];
+ t[1] = a[16] * x2 + a[14];
+ t[2] = b[17] * x2 + b[15];
+ t[3] = b[16] * x2 + b[14];
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[13]);
+ t[1] += static_cast<V>(a[12]);
+ t[2] += static_cast<V>(b[13]);
+ t[3] += static_cast<V>(b[12]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[11]);
+ t[1] += static_cast<V>(a[10]);
+ t[2] += static_cast<V>(b[11]);
+ t[3] += static_cast<V>(b[10]);
+ t[0] *= x2;
+ t[1] *= x2;
+ t[2] *= x2;
+ t[3] *= x2;
+ t[0] += static_cast<V>(a[9]);
+ t[1] += static_cast<V>(a[8]);
+ t[2] += static_cast<V>(b[9]);
+ t[3] += static_cast<V>(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] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[12]);
+ t[1] += static_cast<V>(a[13]);
+ t[2] += static_cast<V>(b[12]);
+ t[3] += static_cast<V>(b[13]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[14]);
+ t[1] += static_cast<V>(a[15]);
+ t[2] += static_cast<V>(b[14]);
+ t[3] += static_cast<V>(b[15]);
+ t[0] *= z2;
+ t[1] *= z2;
+ t[2] *= z2;
+ t[3] *= z2;
+ t[0] += static_cast<V>(a[16]);
+ t[1] += static_cast<V>(a[17]);
+ t[2] += static_cast<V>(b[16]);
+ t[3] += static_cast<V>(b[17]);
+ t[0] *= z;
+ t[2] *= z;
+ return (t[0] + t[1]) / (t[2] + t[3]);
+ }
+}
+
+
+}}}} // namespaces
+
+#endif // include guard
+

Added: sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_19.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/tools/detail/rational_horner3_19.hpp 2007-05-22 04:52:48 EDT (Tue, 22 May 2007)
@@ -0,0 +1,1458 @@
+// (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;
+ 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>