hard_sigmoid

std.elementwise.hard_sigmoid · Level L1

Piecewise-linear sigmoid: relu6(x + 3) / 6. Calls relu6.

relu6(x + 3) / 6

Signature

hard_sigmoid(x: 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]3.0Addshift6.0relu6r6Divideyyf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference np.clip(x + 3, 0, 6) / 6 in exact rational arithmetic, on all 40 test cases.
  • All 147 float64 results inside the running error bound; the closest uses 68% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
90%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
1.00

Identity

Calls
Called by
—
sha256:35b511a2f4c46073cb7bebd7103c3282e0984205b679b42f7411701cb25fe867

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