Yesterday I had problems with another boost functions but luckily you guys helped me to solve them. Today I would need to know how to use bisection function properly.
So here is how I think it should work but never the less it seems that I'm getting this also wrong. Okay 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 set it right. I've tried
double value = boost::math::tools::eps_tolerance<double>(0.00001);
and how to I return the value when the bisection has found ? Should the result be pair of numbers as std::pair in the function and after that just calculate min+max/2?
Thanks !
See Question&Answers more detail:os