triqs.utility.bound_and_bisect.determine_bounds
- triqs.utility.bound_and_bisect.determine_bounds(F, x_0, dx, maxiter)[source]
Bracket a sign change of a monotonic real-valued function.
Starting from
x_0and stepping outward bydx(the sign of the step is chosen from a single forward finite difference so the function decreases toward the lower bound and increases toward the upper bound), returns an interval \([a, b]\) such that \(F(a) < 0 < F(b)\).- Parameters:
- Fcallable
Real-valued function of one real argument. Assumed to be monotonic on the relevant range.
- x_0float
Initial guess used as the starting point for the search.
- dxfloat
Magnitude of the step taken at each iteration. The sign is set internally from
F(x_0 + dx) - F(x_0).- maxiterint
Maximum number of outward steps allowed in either direction before giving up.
- Returns:
- afloat
Lower bound with
F(a) < 0.- bfloat
Upper bound with
F(b) > 0.
- Raises:
- ValueError
If no lower or upper bound is found within
maxitersteps.