proj

std.linalg.proj · Level L0

Orthogonal projection of x onto the line spanned by u. Calls dot twice.

(x·u / u·u)·u

Signature

proj(x: f64[n], u: f64[n]) → 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.

xf64[n]uf64[n]dotxudotuuDividecMultiplyppf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference (np.dot(x, u) / np.dot(u, u)) * u in exact rational arithmetic, on all 40 test cases.
  • All 122 float64 results inside the running error bound; the closest uses 38% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
74%
bit-equal to the NumPy formula in float64
99%
largest error, in units in the last place
2.42

Identity

Calls
Called by
sha256:a7346794b0cb14b83033454c8a56cd070778b5f65c965dc9d5b7b93635d567ec

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