lerp

std.elementwise.lerp · Level L0

Linear interpolation from a to b by a scalar t.

a + t·(b − a)

Signature

lerp(a: f64[n], b: f64[n], t: 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 a call to another library function; select it to open that function.

af64[n]bf64[n]tf64[]SubtractspanMultiplystepAddyyf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference (1 - t) * a + t * b in exact rational arithmetic, on all 40 test cases.
  • All 159 float64 results inside the running error bound; the closest uses 76% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
75%
bit-equal to the NumPy formula in float64
70%
largest error, in units in the last place
418

Large ulp counts appear only where cancellation drives a result toward zero; the absolute error is still inside the bound.

Identity

Calls
—
Called by
—
sha256:20f09691dd2fc258a9ee6e0c1c4ea59471bdde7a81985126ec8839b7b901b9f7

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