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 / apps / aienos-site / om / lab-page / axpy.om

15 lines · 422 bytes Raw Blame History
1note y[i] = a*x[i] + y[i]: one element per call.
2fn axpy a long x long y long to long
3ret add mul a x y
4end
5note The grid: elements lo to hi-1, with x[i] = i and y[i] = 2i+1 generated in place.
6note Returns the sum of the results so a host can check every element.
7fn run a long lo long hi long to long
8s = long 0
9i = lo
10while lt i hi bound 999999
11s = add s axpy a i add mul long 2 i long 1
12i = add i long 1
13end
14ret s
15end