bisect
std.func.bisect · Level L3A root of f in each bracket [lo, hi], where f(lo) and f(hi) differ in sign: bisection until every bracket is at most tol wide, then the midpoint. A While with two carries, lo and hi. A template over f, verified through f = silu; a test finds π/2 and 3π/2 as roots of cos.
Signature
bisect(lo: f64[n], hi: f64[n], tol: f64[]) → f64[n]
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Agrees with the reference
witness f = silu: halve every bracket while the widest is wider than tolto 80 digits (100-digit arithmetic), on all 40 test cases. - All 169 float64 results inside the running error bound; the closest uses 27% of it.
- Interpreter and NumPy backend return bit-identical results.
- At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 37% of it.
- correctly rounded (the float64 nearest the exact value)
- 80%
- bit-equal to the NumPy formula in float64
- 100%
- largest error, in units in the last place
- 220
Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.
Note
tol must be wider than the spacing of floating-point numbers near the roots. A bracket one unit of roundoff wide cannot be halved, so a smaller tol reaches max_steps, and the loop fails rather than return a bracket it did not narrow. The verification follows each case's exact path and checks that every sign decision is certain.
Identity
sha256:150b34cdadef157df0370b8a299579be472597b4e3fcf4334ad2f3973e781e49The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.func.bisect[f=std.elementwise.silu]
- Pins
sha256:db4d38edda1d59f963abbdbae5ba2c08b069ec019803dbe4bef1ced88292f7fethis graph and the 3 it reaches through calls- Evidence
sha256:6a4d212f5c1fb057ac77f291e2d52bf30084360b036e5987f18a7eecc202b0d0the hash of its verification record- Needs
- no capability: a pure function
Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.