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 / train / aien-train / native / neuralese / nl1r / quantcheck.om

59 lines · 869 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Verification-only actual-byte quantization and perturbation controls.
3fn ties q ulong a f64 b f64 to int
4put NH 0 a
5put NH 1 neg a
6put NH 2 div a 2.0f64
7npack
8npert q
9if ne bitcast f64 wget 0 b
10ret 81
11end
12if ne bitcast f64 wget 1 neg b
13ret 82
14end
15if ne bitcast f64 wget 2 0.0f64
16ret 83
17end
18ret 0
19end
20fn main to int
21rc = nshape 0
22rc = ties 1 0.03125f64 0.0625f64
23if ne rc 0
24ret rc
25end
26rc = ties 2 0.015625f64 0.03125f64
27if ne rc 0
28ret rc
29end
30put NH 0 0.25f64
31put NH 1 -0.5f64
32put NH 2 0.75f64
33npack
34npert 3
35if ne bitcast f64 wget 0 -0.25f64
36ret 84
37end
38if ne bitcast f64 wget 1 -0.5f64
39ret 85
40end
41npack
42npert 4
43if ne bitcast f64 wget 0 -0.5f64
44ret 86
45end
46if ne bitcast f64 wget 1 0.25f64
47ret 87
48end
49if ne bitcast f64 wget 2 0.75f64
50ret 88
51end
52npert 5
53for k ulong 3
54if ne bitcast f64 wget k 0.0f64
55ret 89
56end
57end
58ret 0
59end