softplus

std.elementwise.softplus · Level L1

Softplus in its overflow-free form. Mathematically identical to log(1 + eˣ), which the reference uses.

max(x, 0) + log(1 + e^(−|x|))

Signature

softplus(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]0.0absaxMaximumposNegatenax1.0ExpeAddonepLoglAddyyf64[n]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Agrees with the reference np.log(1 + np.exp(x)) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 179 float64 results inside the running error bound; the closest uses 92% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
64%
bit-equal to the NumPy formula in float64
80%
largest error, in units in the last place
5.0e+15

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

Note

The graph never computes eˣ for large x, so it cannot overflow; the verification shows it equals the naive formula exactly in 100-digit arithmetic.

Identity

Calls
Called by
sha256:e00e8077e869c7e53775311763ea34b8110b7cc39893d47551f81d7d91054419

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