rnn_cell

std.nn.rnn_cell · Level L0

One step of an Elman recurrent network: the next hidden state from the current one and an input. The body that rnn scans.

h′ = tanh(W·h + U·x + b)

Signature

rnn_cell(h: f64[k], x: f64[m], W: f64[k, k], U: f64[k, m], b: f64[k]) → f64[k]

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.

hf64[k]Wf64[k, k]xf64[m]Uf64[k, m]bf64[k]ReshapehcReshapexcMatMulWhMatMulUxAddpre_cReshapepreAddzTanhh2h2f64[k]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Agrees with the reference np.tanh(W @ h + U @ x + b) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 140 float64 results inside the running error bound; the closest uses 18% 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 19% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
84%
largest error, in units in the last place
6.74

Identity

Calls
—
Called by
sha256:9a700122c77baec1c1c1277c658bd5b0ca5bfa54458f876385416330f4a0fc2d

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

Control handle

Symbol
Ω:std.nn.rnn_cell · Ω:rnn_cell
Pins
sha256:a4ee055281dd156f83d5893f7709905cf75c5d9b4aaa526231eb2c49d0d1a970this graph alone
Evidence
sha256:f96bfa382d0c2403ad589ef4ef10c6d84c390bdd8628512e491657d0453bf510the 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.