#pragma once
#endif
-#include <boost/tr1/tuple.hpp>
+#include <boost/math/tools/tuple.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/math/tools/roots.hpp>
BOOST_MATH_INSTRUMENT_VARIABLE(b);
if((b > 0.6) || ((b >= 0.45) && (a >= 0.3)))
{
- // DiDonato & Morris Eq 21:
+ // DiDonato & Morris Eq 21:
//
// There is a slight variation from DiDonato and Morris here:
// the first form given here is unstable when p is close to 1,
{
T z = w;
T ap1 = a + 1;
+ T ap2 = a + 2;
if(w < 0.15f * ap1)
{
// DiDonato and Morris Eq 35:
T v = log(p) + boost::math::lgamma(ap1, pol);
- T s = 1;
z = exp((v + w) / a);
- s = boost::math::log1p(z / ap1 * (1 + z / (a + 2)));
+ s = boost::math::log1p(z / ap1 * (1 + z / ap2));
z = exp((v + z - s) / a);
+ s = boost::math::log1p(z / ap1 * (1 + z / ap2));
z = exp((v + z - s) / a);
- s = boost::math::log1p(z / ap1 * (1 + z / (a + 2) * (1 + z / (a + 3))));
+ s = boost::math::log1p(z / ap1 * (1 + z / ap2 * (1 + z / (a + 3))));
z = exp((v + z - s) / a);
BOOST_MATH_INSTRUMENT_VARIABLE(z);
}
}
}
- std::tr1::tuple<T, T, T> operator()(const T& x)const
+ boost::math::tuple<T, T, T> operator()(const T& x)const
{
BOOST_FPU_EXCEPTION_GUARD
//
// flag is set, then Q(x) - q and it's derivatives.
//
typedef typename policies::evaluation<T, Policy>::type value_type;
- typedef typename lanczos::lanczos<T, Policy>::type evaluation_type;
+ // typedef typename lanczos::lanczos<T, Policy>::type evaluation_type;
typedef typename policies::normalise<
Policy,
policies::promote_float<false>,
f2 = -f2;
}
- return std::tr1::make_tuple(f - p, f1, f2);
+ return boost::math::make_tuple(static_cast<T>(f - p), f1, f2);
}
private:
T a, p;
tools::max_value<T>(),
digits,
max_iter);
- policies::check_root_iterations(function, max_iter, pol);
+ policies::check_root_iterations<T>(function, max_iter, pol);
BOOST_MATH_INSTRUMENT_VARIABLE(guess);
if(guess == lower)
guess = policies::raise_underflow_error<T>(function, "Expected result known to be non-zero, but is smaller than the smallest available number.", pol);
tools::max_value<T>(),
digits,
max_iter);
- policies::check_root_iterations(function, max_iter, pol);
+ policies::check_root_iterations<T>(function, max_iter, pol);
if(guess == lower)
guess = policies::raise_underflow_error<T>(function, "Expected result known to be non-zero, but is smaller than the smallest available number.", pol);
return guess;