wrap_angle

std.elementwise.wrap_angle · Level L4

An angle wrapped into [0, 2π): the remainder after dividing by 2π, which takes the divisor's sign, so negative angles come out positive.

θ mod 2π

Signature

wrap_angle(theta: 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 another library function this one runs — called once, or by Scan once per element; select it to open that function.

thetaf64[n]6.28319Modwrappedwrappedf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference np.mod(theta, 2π) in exact rational arithmetic, on all 40 test cases.
  • All 138 float64 results inside the running error bound; the closest uses 97% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
100%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
0.50

Identity

Calls
—
Called by
—
sha256:26e068358dee14fce2219e975485183ee699a48d600199818878d7840ab834ef

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