For a requested absolute tolerance , stop when the retained root bracket has width at most , and report its midpoint. The bisection error bound then guarantees in exact arithmetic. Using the ceiling function and the base-two logarithm, the required number of halvings is
The zero allows stopping before any update when the initial root bracket is already sufficiently narrow. For the polynomial on with , . After nine halvings,
Thus the reported midpoint meets the tolerance; its actual error from the square root is approximately . After eight halvings the bound is , so eight do not give this worst-case guarantee.
Cache the endpoint values. Each update of the bisection method needs just one new function evaluation, at the old midpoint. With no early zero of a function, updates therefore cost function evaluations, including the two initial endpoints. Returning the new midpoint requires no additional function evaluation; requesting its value would add one. The nine-update example needs eleven evaluations for the guarantee.
A small function value alone does not guarantee a small position error: rescaling changes those values without changing its zeros of a function. In a practical implementation, use an explicit width test and an iteration limit. With floating-point arithmetic, also stop if the computed midpoint equals either endpoint: the root bracket can no longer shrink, so repeating the update would loop forever. Report this precision limit separately if the requested tolerance remains unmet. Reliable sign evaluations are needed to preserve the root bracket; compare signs directly rather than multiplying endpoint values, which can suffer overflow or underflow in floating-point arithmetic.
For a rounded midpoint still inside a valid root bracket, the geometric error bound is ; it need not equal because of roundoff error. A rigorous computed enclosure also needs conservative arithmetic for that bound and reliable endpoint signs. The exact-arithmetic bisection error bound should not be claimed unchanged after precision prevents further halving.
For practical tolerance conventions, SciPy's bisect combines absolute and relative tolerances through , and provides a maximum iteration count and convergence status. These differ from the purely absolute width test above.[ref]
Bracketing method 2026-10-14
A bracketing method finds a zero of a function by maintaining a root bracket and shrinking it as new values of the function become available. The bisection method always tries the midpoint; its special attraction is a predictable bisection error bound without any derivative evaluations.
Every allocation in the convex feasible region for a resource budget is a convex combination of its three extreme points:
The condition is exactly ; nonnegative give the other two nonnegative coefficients. Thus the half-space description and the convex hull description encode the same triangle. At all three coefficients are , and at they are , , . The green and orange points in the budget diagram therefore have two complementary interpretations: direct resource constraints and mixtures of extreme choices.
The three extreme points alone are not a convex set, because their midpoints are absent. Their convex hull fills the whole triangle. More generally, Caratheodory theorem bounds how many generating points are needed for one convex combination in a finite-dimensional real vector space; its geometric content is that a complicated collection can describe each attainable average with a short representation.
Consider a stipulated continuous-allocation problem. Amounts of two activities use units of a common resource, with budget six. The feasible region
is a triangle with extreme points , and . It is the intersection of three closed half-spaces, hence a closed convex set. The general intersection argument is short: a line segment between two points in every constraint set belongs to every constraint set, so it belongs to their intersection.[ref]
For an original numerical check, take and . Their resource totals are and . Every convex combination is nonnegative and has resource total
In particular the midpoint is , using units. This verifies the full line segment, rather than just a plotted sample of it.
Figure 1.
Feasible averages and convex weights in a continuous resource budget
. Original continuous-allocation model , , . The orange line segment joins two feasible allocations; the green point is the equal-weight convex combination of the three extreme points. The shaded region is their convex hull, not just the three generating points. Details.
This is useful whenever divisible quantities share linear limits: the feasible choices remain compatible under averaging. A new linear equation also preserves this property, because averaging two identical constraint values gives the same value. The affine subspace and closed half-space viewpoints explain this without requiring a separate argument for every budget.
Convex set Created 2026-09-24 Updated 2026-10-13
A convex set permits every intermediate mixture of two of its points. If two choices meet its constraints, continuously averaging them also meets those constraints. This geometric property makes many feasible regions easier to explore: there is no forbidden gap along a straight move between feasible choices.
Formally, a subset of a real vector space is convex when
The parameter traverses the entire line segment, including both endpoints. The definition does not require a closed subset, a bounded set, or a nonempty interior. The empty set, the whole vector space, and every affine subspace are convex; an open unit disk and a closed unit disk are both convex.[ref]
The triangle inequality verifies the disk example directly: if , then . For the open disk, the last inequality is strict. The unit circle fails the same test: and belong to it, but their midpoint does not. A curved route along the unit circle connects the endpoints, so being path-connected is weaker than being a convex set.
Figure 1.
A disk contains every chord, while a circle omits its chords
. Original comparison of the closed unit disk and the unit circle. The circle's midpoint counterexample is explicit; the shaded disk panel illustrates one line segment, with the general statement established by the triangle inequality. Details.
The distinction between a convex set and a convex function matters. The former concerns where one may choose a point; the latter concerns how a value changes along line segments. Convex optimization combines both: averaging preserves feasibility, and a convex function obeys an upper bound by the corresponding average of endpoint values. A convex set alone does not make an arbitrary objective a convex function or eliminate its inferior local minima.
De Casteljau's algorithm 2026-10-14
De Casteljau's algorithm evaluates a Bézier curve by repeated linear interpolation between neighboring control points. Fix , start with , and compute
Each new row has one fewer point. The final point is . Use the same at every stage: it describes the fraction of each line segment traversed from its first endpoint toward its second. A cubic Bézier curve needs three levels containing , , and linear interpolations, respectively.[ref]
For the Bézier curve with control points , , , , evaluation at takes the midpoint of every neighboring pair. The first level gives
The second level gives
and the third level gives
The intermediate control polygons shrink toward the evaluated point. Each step is a convex combination, giving a geometric explanation of the convex hull property; every step also commutes with an affine map.
Figure 1.
Cubic Bézier curve, its convex hull and bounding box, and the three levels of De Casteljau's algorithm at t = 1/2
. Details.
The same construction splits the Bézier curve exactly, with no approximation. The outer edges of the triangular array give the new control points: for a cubic, specify the left piece and specify the right piece.[ref] At these two lists are
Write and for the Bézier curves defined by these lists, each with its own parameter . Then
Their images reproduce the original curve, while their derivatives account for the shorter parameter intervals. At the join,
The chain rule gives ; in the original parameter, both pieces have derivative . This is the interval scaling in the parametric first-derivative join of Bézier curves.
Figure 2.
Exact midpoint subdivision with two smaller control polygons, endpoint tangent directions, and equally spaced parameter samples
. Details.
Repeated midpoint splitting is useful for drawing vector graphics paths: each piece has a smaller control polygon and its own convex hull enclosure. A renderer can refine pieces until they are sufficiently close to line segments at the chosen display scale. Evaluating and splitting it are thus two results of the same short algorithm.
For a proof outline, expanding the recursion gives
Pascal's identity proves this by induction; at , it is precisely the Bernstein basis formula for the Bézier curve. The geometric construction remains useful even when expanding the polynomial by hand would be cumbersome.
// Target: analysis.bigb
If the amounts in the budget example must be integers, the actual feasible region is . Both and are feasible, but their midpoint is not. Thus the continuous feasible region is a convex set while the integer-restricted choices are not. Averaging two manufacturing plans may specify half an indivisible item. Integer programming must respect that restriction; using the surrounding convex set is a relaxation, not a proof that its averages are admissible integer plans.
Interval bisection Created 2026-10-07 Updated 2026-10-14
Interval bisection solves a target equation by repeatedly halving a closed interval known to contain a solution. It is the bisection method applied to , so the target becomes a zero of a function. This reduction from an equation to root finding is described in Demanet's notes.[ref] Here the emphasis is on a continuous strictly increasing function: the target identifies one input, making interval bisection a way to evaluate its inverse function without an explicit inverse formula.
Let be a continuous function, with and . The intermediate value theorem guarantees existence; a strictly increasing function also guarantees uniqueness. Check endpoint equality first. Otherwise, for the current root bracket , evaluate its midpoint . If , retain ; if , retain ; if , return that exact solution. These comparisons preserve the target bracket. General bisection method needs continuity and opposite signs of at the endpoints, without requiring monotonicity or a unique zero of a function; see limitations of bisection.
An original dimensionless polynomial example is
Here and the derivative , so there is exactly one solution. In fact ; knowing this lets us check the computed absolute error independently of the guarantee. The first four halvings give the following exact rational numbers:
Figure 1.
Finding the input for a target output: cubic graph and four retained brackets
. Details.
The beauty of interval bisection is that the enclosure itself supplies the certificate: one comparison removes half the possible inputs, regardless of the steepness of the function graph. In exact arithmetic, after completed halvings without exact termination, the width and the bisection error bound for the new midpoint are
The reported midpoint after update four is , rather than the last tested point . Its certified absolute error is at most , and its actual absolute error is . For a requested position tolerance , the bisection stopping criterion requires eleven halvings: ten give , while eleven give
The actual absolute error is . The new midpoint need not be evaluated to obtain this certificate.
The signed output residual is ; the position approximation error is . They answer different questions: how close is the output to the target, and how close is the input to the solution? Driscoll and Braun explain why a small residual needs information about the derivative to imply small position error.[ref] For this particular polynomial, direct factorization gives
Thus at the residual is , despite position absolute error . If a differentiable function satisfies throughout the bracket, the mean value theorem gives the rigorous conversion
Our example permits and on . Strict increase alone supplies no positive lower derivative bound: is strictly increasing but . A small residual alone is therefore not a universal position certificate; even the target equation has residual at , a full unit from its solution.
Figure 2.
Certified position error and output residual measure different distances
. Details.
The guarantees require continuity and correct evaluations, not just narrowing endpoints. For the strictly increasing function when and when , the target lies between and but is never attained: a jump discontinuity defeats the existence argument. With floating-point arithmetic or an approximate evaluation, an incorrect comparison can discard the true solution. A certified interval enclosure of wholly below or above certifies the corresponding decision; an enclosure containing is inconclusive, rather than proof of equality. If rounding makes the midpoint equal an endpoint, report the precision limit; see bisection stopping criterion for the rounded position bound. Both figures are exact mathematical examples, not measured data.
Limitations of bisection 2026-10-14
Several zeros of a function can lie in one initial root bracket: the bisection method seeks one, rather than enumerating them. For instance, the polynomial has opposite endpoint signs on , but its first midpoint evaluation returns only the polynomial root . The initial zero of a function need not be unique for the bisection error bound to apply to a retained zero of a function.
A zero of a function without a sign change cannot be located by the strict sign-change test alone. The polynomial touches zero at but is positive on either side. On both endpoint values are positive: although the closed interval contains a polynomial root, it fails the usual starting test for the bisection method. An endpoint or evaluated midpoint zero of a function can still be recognized directly.
Opposite signs certify a root bracket only with the required continuity. For , the values at and have opposite signs, but is undefined at the midpoint and has no zero of a function. Hence is invalid input for the bisection method; the intermediate value theorem does not apply across the gap.
Checking only midpoints is not enough for an arbitrary subset of a real vector space. The rational numbers contain the midpoint of every pair of rational numbers, but the line segment from to also contains irrational numbers. For instance lies on that line segment and is not rational. This shows why the definition quantifies over every real .
There is a useful additional hypothesis: a closed subset containing the midpoint of every pair of its points is a convex set. Repeated bisection includes all points with dyadic rational . These coefficients approach every real ; being a closed subset then includes each limit. This is a short proof outline, and the rational numbers example identifies precisely why a closed subset was required.