interplane.Get Omega
Read in your language

yang

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

yang / src / ufbi_phase3b_cert.om

191 lines · 4582 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note src/ufbi_phase3b_cert.om: Pure Seeded-OM-2 Zero-Monte-Carlo Dual-Cliff Verifier (Phase III-B)
3note
4note Part A computes numerical box estimates for the parallel and transverse one-link speeds.
5note Part B evaluates the star-cell remainder formulas on the sampled beta and cutoff grid.
6note Part A uses integer dyadic quadrature. Part B uses padded binary64 arithmetic.
7
8note Composed after src/ufbi_math.om, src/ufbi_ivmath.om and src/ufbi_w2_dyadic.om.
9
10global bRes f64 8
11global bTmp f64 8
12
13text tP3Hdr "=== PHASE III-B ZERO-MONTE-CARLO DUAL-CLIFF VERIFIER (PURE SEEDED OM-2) ===\n"
14text tP3AHdr "=== PART A: RIGHT CLIFF — DYADIC S^3 W_2 TRIAL ENERGIES (2048 x 128 BOXES) ===\n"
15text tP3ACols "beta\tW2_par_hi\tW2_perp_hi\tL_W2_hi\tUnfix18_W2_hi\tTG14_W2_hi\tcert\n"
16text tP3BHdr "=== PART B: PADDED BINARY64 STAR-CELL DIAGNOSTICS — 4D STAR K_{2,2,2,2} THEOREM 13 (161/96b, y_max=u^2/64b, e^{+y}-1, chi_21^2) ===\n"
17text tP3BCols "beta\topt_u\trMax_hi\tyMax_hi\trem_exp_hi\trem_haar_hi\ttail_LF_hi\ttot_int_hi\ttot_full_hi\tstatus\n"
18text tPassU "PASS_UNFIX18"
19text tPassTG "PASS_TG14_W2"
20text tOpen "OPEN"
21text tClosedFull "CLOSED_FULL"
22text tClosedInt "CLOSED_INT_ONLY"
23text tTab "\t"
24text tNl "\n"
25text tDone "PHASE3B_CERT_DONE status=PASS\n"
26
27fn max2 a f64 b f64 to f64
28if gt a b
29ret a
30end
31ret b
32end
33
34fn scanW2Beta bps long to void
35scanDyadicW2 bps
36beta = div f64 bps 10000.0f64
37par = uSqrt64 div f64 get wMaxEnergy 0 f64 wScale
38perp = uSqrt64 div f64 get wMaxEnergy 1 f64 wScale
39energy = larger get wMaxEnergy 0 get wMaxEnergy 1
40lW2 = max2 par perp
41u18 = mul 18.0f64 mul beta lW2
42tg14 = mul 14.0f64 mul beta lW2
43uPrintF64 beta
44uPrint tTab
45uPrintF64 par
46uPrint tTab
47uPrintF64 perp
48uPrint tTab
49uPrintF64 lW2
50uPrint tTab
51uPrintF64 u18
52uPrint tTab
53uPrintF64 tg14
54uPrint tTab
55if ne dyadicSubunit energy 18 bps 0
56uPrint tPassU
57else
58if ne dyadicSubunit energy 14 bps 0
59uPrint tPassTG
60else
61uPrint tOpen
62end
63end
64uPrint tNl
65end
66
67note =========================================================================
68note PART B: Exact Theorem 13 4D Star Cell K_{2,2,2,2} Saddle + Remainder Enclosure
69note bRes: 0=optU, 1=rMax, 2=yMax, 3=remExp, 4=remHaar, 5=tailLf, 6=totInt, 7=totFull
70note =========================================================================
71fn chi21Tail u f64 to f64
72q = ivHi div u 21.0f64
73q2 = ivHi mul q q
74q4 = ivHi mul q2 q2
75q10 = ivHi mul q4 ivHi mul q4 q2
76p105 = ivHi mul q10 ivHi uSqrt64 q
77ex = ivHi uExp64 neg ivLo mul 0.5f64 sub u 21.0f64
78ret ivHi mul p105 ex
79end
80
81fn tryStarU beta f64 u f64 to void
82rMax = ivHi uSqrt64 ivHi div u mul 6.0f64 beta
83if ge rMax 3.10f64
84ret
85end
86put bTmp 1 rMax
87yMax = ivHi div ivHi mul u u mul 64.0f64 beta
88put bTmp 2 yMax
89put bTmp 3 ivHi mul ivHi uExp64 yMax ivHi div 161.0f64 mul 96.0f64 beta
90put bTmp 4 ivHi div 25.0f64 mul 24.0f64 beta
91put bTmp 5 chi21Tail u
92put bTmp 6 ivHi add get bTmp 3 get bTmp 5
93put bTmp 7 ivHi add get bTmp 6 get bTmp 4
94if lt get bTmp 7 get bRes 7
95put bRes 0 u
96put bRes 1 get bTmp 1
97put bRes 2 get bTmp 2
98put bRes 3 get bTmp 3
99put bRes 4 get bTmp 4
100put bRes 5 get bTmp 5
101put bRes 6 get bTmp 6
102put bRes 7 get bTmp 7
103end
104end
105
106fn evalStarSaddle beta f64 to void
107put bRes 0 0.0f64
108put bRes 1 99.0f64
109put bRes 2 999.0f64
110put bRes 3 999999.0f64
111put bRes 4 999999.0f64
112put bRes 5 999999.0f64
113put bRes 6 999999.0f64
114put bRes 7 999999.0f64
115for idx ulong 197
116u = add 22.0f64 mul f64 idx 0.5f64
117tryStarU beta u
118end
119uPrintF64 beta
120uPrint tTab
121uPrintF64 get bRes 0
122uPrint tTab
123uPrintF64 get bRes 1
124uPrint tTab
125uPrintF64 get bRes 2
126uPrint tTab
127uPrintF64 get bRes 3
128uPrint tTab
129uPrintF64 get bRes 4
130uPrint tTab
131uPrintF64 get bRes 5
132uPrint tTab
133uPrintF64 get bRes 6
134uPrint tTab
135uPrintF64 get bRes 7
136uPrint tTab
137if lt get bRes 7 1.0f64
138uPrint tClosedFull
139else
140if lt get bRes 6 1.0f64
141uPrint tClosedInt
142else
143uPrint tOpen
144end
145end
146uPrint tNl
147end
148
149text tTrigFail "TRIG_ENDPOINT status=FAIL\n"
150
151fn main to int
152initTrigGrid
153initW2Angles
154if eq trigGridOK 0
155uPrint tTrigFail
156ret 1
157end
158uPrint tP3Hdr
159uPrint tP3AHdr
160uPrint tP3ACols
161scanW2Beta 1000
162scanW2Beta 1272
163scanW2Beta 1500
164scanW2Beta 1800
165scanW2Beta 1900
166scanW2Beta 1950
167scanW2Beta 2000
168scanW2Beta 2200
169scanW2Beta 2400
170scanW2Beta 2450
171scanW2Beta 2500
172if ne get wFailed 0 0
173ret 1
174end
175uPrint tP3BHdr
176uPrint tP3BCols
177evalStarSaddle 2.30f64
178evalStarSaddle 5.00f64
179evalStarSaddle 10.00f64
180evalStarSaddle 11.00f64
181evalStarSaddle 12.00f64
182evalStarSaddle 13.00f64
183evalStarSaddle 14.00f64
184evalStarSaddle 15.00f64
185evalStarSaddle 20.00f64
186evalStarSaddle 30.00f64
187evalStarSaddle 50.00f64
188evalStarSaddle 100.00f64
189uPrint tDone
190ret 0
191end