Yesterday I had problems with other enhancement features, but fortunately you guys helped me solve them. Today I will need to know how to use the bisection function correctly.
So, this is how I think it should work, but nonetheless it seems like I'm wrong too. Ok, so I would like to use:
template <class F, class T, class Tol>
std::pair<T, T>
bisect(
F f,
T min,
T max,
Tol tol);
from here , but my problem is with tolerance because I donβt know how to install it correctly. I tried
double value = boost::math::tools::eps_tolerance<double>(0.00001);
and how to return the value when detecting division in half? If the result is a pair of numbers like std :: pair in a function, and then just calculate min + max / 2?
Thank!
source
share