affine_line

std.elementwise.affine_line · Level L1

The affine function f(x) = m·x + b through two points (x₁, y₁) and (x₂, y₂): whether it is defined (x₁ ≠ x₂, as 1 or 0), its slope m = (y₂ − y₁)/(x₂ − x₁), and its intercept b (both 0 when undefined). With m = 0 it is constant; it is linear in the sense of linear algebra only when b = 0.

m = (y₂ − y₁)/(x₂ − x₁), b = y₁ − m·x₁

Signature

affine_line(x1: f64[], y1: f64[], x2: f64[], y2: 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.

x1f64[]x2f64[]y2f64[]y1f64[]0.0SubtractdxSubtractdy1.0EqualverticalSubtractdefinedAddsafeDividem_rawMultiplyslopeMultiplymxSubtractinterceptMultiplybbf64[]slopef64[]definedf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference the two-point formulas in exact arithmetic in exact rational arithmetic, on all 40 test cases.
  • All 120 float64 results inside the running error bound; the closest uses 41% 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 48% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
84%
bit-equal to the NumPy formula in float64
98%
largest error, in units in the last place
3.3e+5

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:611c4dba08ce20a488b79a0b15dfe519ca3fb6b3633646979a570f2569f21b36

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

Control handle

Symbol
Ω:std.elementwise.affine_line · Ω:affine_line
Pins
sha256:9bdb25afd5d5ef8d4acd59573bb5465a075e95b48a2e75538468637b49f78635this graph alone
Evidence
sha256:6aab1f8969d87d572245f581d241e6e44dfedd0cbf0688176b12de09ae50b2c7the 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.