lp_weak_duality

std.optim.lp_weak_duality · Level L1

Weak duality for max cᵀx, A·x ≤ b, x ≥ 0 and its dual min bᵀy, Aᵀy ≥ c, y ≥ 0: whether x and y are feasible, and the three numbers cᵀx ≤ yᵀAx ≤ bᵀy, which feasibility guarantees. Feasible x and y with cᵀx = bᵀy are both optimal, a certificate for each.

cᵀx ≤ yᵀA x ≤ bᵀy

Signature

lp_weak_duality(A: f64[m, n], b: f64[m], c: f64[n], x: f64[n], y: f64[m]) → f64[], 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.

Af64[m, n]xf64[n]bf64[m]0.0yf64[m]cf64[n]matvecAxLessx_negvecmatAtyLessy_negdotcxdotbyGreaterax_leReduceMaxbad_p2dotyAxLessaty_ltReduceMaxbad_d2ReduceMaxbad_p1ReduceMaxbad_d1Maximumbad_p1.0Maximumbad_dSubtractprimal_okSubtractdual_okprimal_okf64[]yAxf64[]dual_okf64[]cxf64[]byf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference feasibility of x and y; c·x, y·A·x, b·y in exact rational arithmetic, on all 40 test cases.
  • All 200 float64 results inside the running error bound; the closest uses 62% 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 44% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
81%
bit-equal to the NumPy formula in float64
94%
largest error, in units in the last place
45

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.

Identity

Calls
Called by
—
sha256:3450a78efaa030aef2bd649b82d4f236aaf5bf73094a52cccd0b63d9d36fcf6f

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

Control handle

Symbol
Ω:std.optim.lp_weak_duality · Ω:lp_weak_duality
Pins
sha256:7ec020269667982405b1635343b041ced0f1a7babc2fc0c0c383a0353971e9ccthis graph and the 3 it reaches through calls
Evidence
sha256:1504a7e84377a03477cab34baf948468d1bd470a0c355a47fde8d31fc2368e0ethe 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.