2 #ifndef __kl_arbitrary_precision_root__
3 #define __kl_arbitrary_precision_root__
6 #include <boost/math/tools/roots.hpp>
9 namespace boost{
namespace math{
namespace tools{
11 template <
class F,
class T>
14 template <
class F,
class T>
17 template <
class F,
class T>
20 template <
class F,
class T>
21 T
halley_iterate(F f, T guess, T min, T max,
int digits, boost::uintmax_t& max_iter);
23 template <
class F,
class T>
26 template <
class F,
class T>
27 T
schroeder_iterate(F f, T guess, T min, T max,
int digits, boost::uintmax_t& max_iter);
166 using namespace boost;
175 return std::tr1::make_tuple(sqr * z - a, 3 * sqr, 6 * z);
188 T min = ldexp(0.5, exp/3);
189 T max = ldexp(2.0, exp/3);
190 T guess = ldexp(1.0, exp/3);
191 int digits = std::numeric_limits<T>::digits / 2;
193 cout<<
"The typeid for this datatype is : "<<
typeid(z).name();
195 string zType =
typeid(z).name();
196 int usingArb = zType.compare(
typeid(boost::math::ntl::RR).name());
199 cout<<
"We're using arb precision"<<endl;
200 digits = precision /2;
209 #endif //__kl_arbitrary_precision_root__
std::tr1::tuple< T, T, T > operator()(T const &z)
T kl_arbitrary_precision_root(T z, unsigned int precision)
cbrt_functor(T const &target)