convex_quadratic_on_interval

std.optim.convex_quadratic_on_interval · Level L1

Minimizing f(x) = A·x² + B·x + C over a closed interval [lo, hi]: whether f is convex there (A ≥ 0, which makes the problem a convex optimization problem, the interval being convex), as 1 or 0; a minimizer, the vertex −B/(2A) clipped to the interval when A > 0, otherwise the better endpoint (the first, lo, on a tie); and the minimum value. Comparing two feasible points, or one Jensen instance, decides nothing in general; the global answer here comes from the closed form.

argmin_{[lo,hi]} Ax² + Bx + C

Signature

convex_quadratic_on_interval(A: f64[], B: f64[], C: f64[], lo: f64[], hi: f64[]) → f64[], f64[], f64[]

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.

0.0Af64[]Bf64[]Cf64[]lof64[]hif64[]Lessconc1.0SubtractmBGreaterposAMultiplyflo_btMultiplyflo_atMultiplyfhi_btMultiplyfhi_atSubtractconvexWheresafeA2.0Addflo_lMultiplyflo_qAddfhi_lMultiplyfhi_qMultiplytwoAAddfloAddfhiDividevertexMinimumendvalLesslo_betterMaximumvloWhereendsMinimumvcMultiplyfv_btMultiplyfv_atWherexminAddfv_lMultiplyfv_qAddfvWherefminconvexf64[]fminf64[]xminf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference the vertex or the endpoints, in exact arithmetic in exact rational arithmetic, on all 40 test cases.
  • All 120 float64 results are exact: the error is zero.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them exact, with zero error.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
100%
bit-equal to the NumPy formula in float64
98%
largest error, in units in the last place
0

Identity

Calls
—
Called by
—
sha256:403434335acaa07b721a15d117c5a08f1e6b19ed0fa930230e04c6a5f7a59a3a

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.optim.convex_quadratic_on_interval · Ω:convex_quadratic_on_interval
Pins
sha256:a5c61c1ad711d139a44b82b8d8bb6be5e0feec24d0b93dc43cea9896202e3299this graph alone
Evidence
sha256:5d33d2b6ea2d389dc191d378fa5e735cad919ccd40bf72741b2341a771470102the 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.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.