Skip to content

num::roots::debug::verify_bracket

Defined in header <roots/debug.hpp>

template <class F, class T = real>
requires scalar_function<F, T>
void verify_bracket(F &&f, T a, T b, call_site site = {});

Verify that \(f\) changes sign on \([a,b]\).

Bisection and Brent's method converge because a sign change forces a root inside the interval. Without one they return a value that is not a root and report no error, so the bracket is checked rather than assumed.