softplus

std.elementwise.softplus · Level L1

Softplus in its overflow-free form, as two smooth branches: x + log(1 + e^(−x)) for x ≥ 0 and log(1 + eˣ) for x < 0. Mathematically identical to log(1 + eˣ), which the reference uses.

x + log(1 + e^(−x)) for x ≥ 0, log(1 + eˣ) for x < 0

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

xf64[n]0.0LessnegWherexpWherexnNegatenxp1.0ExpenExpepAddonenAddonepLogynLoglpAddypWhereyyf64[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 93% of it.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 81% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
64%
largest error, in units in the last place
1.3e+9

Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.

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. Since Round 14.29 each branch is fed a safe input (0 on the other side), so the branch not taken stays finite and its reverse-mode gradient is σ(x) everywhere, ½ at x = 0. The earlier form, max(x, 0) + log(1 + e^(−|x|)), gave the same values bit for bit but a gradient of 1 at x = 0.

Identity

Calls
—
Called by
sha256:c9ddf9f39c1181f49751f47d5953f1a7b5b18d763a52ada72725045ddf038b40

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

Control handle

Symbol
Ω:std.elementwise.softplus · Ω:softplus
Pins
sha256:5e4e43344a1981652e7c4e0eee48802720b22d9b50e3af4c74eaeca2c4103088this graph alone
Evidence
sha256:079e634a9ce79cbafb0ba756c13f2c180d456b18af39fa82c5536968821211a5the hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.