catalan
std.elementwise.catalan · Level L4The Catalan number Cₙ = C(2n, n)/(n + 1), elementwise: 1, 1, 2, 5, 14, 42, … The division is exact. The reference uses the recurrence Cₙ₊₁ = Σ CᵢCₙ₋ᵢ instead.
Cₙ = C(2n, n)/(n + 1)
Signature
catalan(n: i64[s]) → i64[s]
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.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
C₀ = 1; Cₙ₊₁ = Σᵢ Cᵢ·Cₙ₋ᵢin exact rational arithmetic, on all 40 test cases. - All 174 int64 results are exact: the error is zero.
- Interpreter and NumPy backend return bit-identical results.
- At float32 too: the 40 test cases rounded to float32, and 40 of them exact, with zero error.
Accuracy in detail
- correctly rounded (the int64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in int64
- 100%
- largest error, in units in the last place
- 0
Identity
sha256:14fb69dc906dd667bfb34afcb9de62ad78df4d3476cba379a298dd1d4c344454The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.elementwise.catalan · Ω:catalan
- Pins
sha256:2c98819316e094169102baf25b65c4b27498c2726896a65b8bc92ff1adef170cthis graph and the 3 it reaches through calls- Evidence
sha256:5b7dfe39acb704e354ea6fa5ce2055a62538756ec7bca3a7ed9610dfd1578b57the 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.