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 / si / benchmarks / native / neuralese / nl1r / fixture.om

173 lines · 2378 bytes Raw Blame History
1note Synthetic checker controls only. Times 1/2 are fixture constants, not measurements.
2text FHEAD "C,"
3text FPAR "P,"
4text FROW "R,"
5text FTAIL "T,1,2\nEND\n"
6text FLEAD "00"
7text FBIG "18446744073709551616"
8fn fparam i ulong mode ulong to void
9jout FPAR
10ix = i
11if and eq mode 25 eq i 0
12ix = 1
13end
14jfield ix
15v = bitcast ulong get JP i
16if eq i 0
17if eq mode 22
18v = 9221120237041090560
19end
20if eq mode 23
21v = 9218868437227405312
22end
23if eq mode 24
24v = bitcast ulong 10000000.0f64
25end
26end
27jnumber v
28jout JLF
29end
30fn frow id ulong q ulong mode ulong to void
31put JR 0 id
32put JR 1 q
33put JC 7 1
34if eq get JC 1 3
35put JC 7 0
36end
37jcapacitywire
38n = ulong 1
39if eq get JC 1 1
40n = 32
41end
42put JR 2 n
43for k ulong 32
44put JR add 3 k ulong get JB k
45end
46jcapacitydecode
47for k ulong 4
48put JR add 35 k bitcast ulong get JS k
49v = ulong 0
50if ge get JS k 0.5f64
51v = 1
52end
53put JR add 39 k v
54end
55put JR 43 0
56for k ulong 4
57if lt fabs sub get JS k 0.5f64 0.1f64
58put JR 43 1
59end
60end
61put JR 44 1
62put JR 45 2
63put JR 46 0
64if and eq id 0 eq q 0
65if eq mode 1
66put JR 3 xor get JR 3 1
67end
68if eq mode 2
69put JR 35 bitcast ulong 0.25f64
70end
71if eq mode 3
72put JR 39 1
73end
74if eq mode 4
75put JR 43 1
76end
77if eq mode 5
78put JR 0 1
79end
80if eq mode 9
81put JR 2 2
82end
83if eq mode 10
84put JR 34 1
85end
86if eq mode 11
87put JR 35 9221120237041090560
88end
89if eq mode 12
90put JR 35 9218868437227405312
91end
92end
93jout FROW
94for k ulong 47
95if and and eq id 0 eq q 0 and eq k 0 eq mode 14
96jout FLEAD
97else
98if and and eq id 0 eq q 0 and eq k 0 eq mode 15
99jout FBIG
100else
101jnumber get JR k
102end
103end
104if lt k 46
105jout JSEP
106end
107end
108jout JLF
109end
110fn main to int
111if ne argcnt 2
112ret 90
113end
114ab = new uchar 3 0
115n = argread 1 ab 0 3
116mode = ulong 0
117for k ulong ulong n
118mode = add mul mode 10 ulong sub get ab k 48
119end
120put JC 0 1
121put JC 1 3
122put JC 2 17
123put JC 3 65535
124put JC 4 1
125put JC 5 0
126put JC 6 0
127put JC 7 0
128if ge mode 21
129put JC 1 1
130put JC 4 4
131put JC 5 40
132put JC 7 1
133for i ulong 4
134put JP add mul i 4 i 2.0f64
135put JP add 16 i -1.0f64
136put JP add 20 add mul i 4 i 1.0f64
137end
138end
139jout FHEAD
140for k ulong 8
141v = get JC k
142if and eq mode 7 eq k 0
143v = 3
144end
145if and eq mode 8 eq k 4
146v = 3
147end
148jnumber v
149if lt k 7
150jout JSEP
151end
152end
153jout JLF
154for i ulong get JC 5
155if not and eq mode 26 eq i 39
156fparam i mode
157end
158end
159for id ulong 16
160for q ulong 6
161if not and eq mode 6 and eq id 15 eq q 5
162frow id q mode
163end
164end
165end
166if ne mode 16
167jout FTAIL
168end
169if eq mode 13
170jout JLF
171end
172ret 0
173end