interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / one_layer / generalization / dev / tasks / cases / devgen02 / prompt

6 lines · 579 bytes Raw Blame History
1Write a function shift_sq_sum that takes an unsigned 8-bit number n and a signed 16-bit number c and
2returns a signed 32-bit number. Define a helper function g that takes signed 32-bit numbers x and c and
3returns (x - c) * (x + c) + x, and use it: shift_sq_sum(n, c) is the sum of g(i, c) for every i from 0 to
4n - 1 (shift_sq_sum(0, c) = 0). Use signed 32-bit arithmetic: when the sum does not fit in a signed
532-bit number, the function traps (overflow). For every input checked, either every partial result fits
6in a signed 32-bit number or the final sum itself does not fit.