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