Current task: —

E-021-sinf-sf-curve.py

Experiments: E-021 · script updated 08-19-2026

E-021-sinf-sf-curve.csv — 299.9 KB, updated 08-19-2026

page 1 of 10 · 500/page · 5000 rows next →
# nS_infS_flambda_nabs_Sf
2 1 -1.55411995594 -0.577215664902 0.0230957089661 0.577215664902
3 2 -1.87453936173 -0.966885096963 0.092345735228 0.966885096963
4 3 -2.01305800766 -1.22069692822 0.207638920554 1.22069692822
5 4 -2.00679765238 -1.37558813187 0.368790479492 1.37558813187
6 5 -1.88272578574 -1.4582685002 0.575542714461 1.4582685002
7 6 -1.66073231493 -1.48829832721 0.827566012282 1.48829832721
8 7 -1.35573072267 -1.48019084024 1.12446011757 1.48019084024
9 8 -0.979100066972 -1.44485574412 1.46575567715 1.44485574412
10 9 -0.539680358409 -1.39059640679 1.85091604838 1.39059640679
11 10 -0.0444643205031 -1.3238036837 2.27933936319 1.3238036837
12 11 0.500918062398 -1.24944277582 2.75036083822 1.24944277582
13 12 1.09185707369 -1.17139824694 3.26325532062 1.17139824694
14 13 1.72451874073 -1.09272131711 3.81724005785 1.09272131711
15 14 2.39566826609 -1.01580941259 4.41147767868 1.01580941259
16 15 3.10254095094 -0.942538421086 5.04507937203 0.942538421086
17 16 3.84274658749 -0.874361661381 5.71710824887 0.874361661381
18 17 4.61419765951 -0.812385212605 6.42658287212 0.812385212605
19 18 5.41505465532 -0.757426282975 7.17248093829 0.757426282975
20 19 6.24368381994 -0.710059274376 7.95374309431 0.710059274376
21 20 7.09862405929 -0.670652812799 8.76927687209 0.670652812799
22 21 7.97856066337 -0.639400059776 9.61796072314 0.639400059776
23 22 8.8823041765 -0.61634395843 10.4986481349 0.61634395843
24 23 9.80877320409 -0.601398606428 11.4101718105 0.601398606428
25 24 10.7569802686 -0.594367623933 12.3513478926 0.594367623933
26 25 11.726020058 -0.594960154932 13.3209802129 0.594960154932
27 26 12.7150595725 -0.602804976097 14.3178645486 0.602804976097
28 27 13.7233297971 -0.617463068699 15.3407928658 0.617463068699
29 28 14.7501186089 -0.638438922648 16.3885575316 0.638438922648
30 29 15.794764699 -0.665190777936 17.459955477 0.665190777936
31 30 16.8566523295 -0.697139961284 18.5537922908 0.697139961284
32 31 17.935206788 -0.733679440083 19.6688862281 0.733679440083
33 32 19.0298904258 -0.774181688583 20.8040721144 0.774181688583
34 33 20.1401991893 -0.8180059405 21.9582051298 0.8180059405
35 34 21.2656595702 -0.864504886176 23.1301644564 0.864504886176
36 35 22.405825913 -0.913030860008 24.318856773 0.913030860008
37 36 23.5602780295 -0.962941554138 25.5232195836 0.962941554138
38 37 24.7286190771 -1.01360528686 26.7422243639 1.01360528686
39 38 25.9104736665 -1.06440584826 27.9748795148 1.06440584826
40 39 27.1054861683 -1.11474694111 29.2202331094 1.11474694111
41 40 28.3133191924 -1.16405623139 30.4773754238 1.16405623139
42 41 29.5336522202 -1.21178902014 31.7454412403 1.21178902014
43 42 30.7661803697 -1.25743154652 33.0236119162 1.25743154652
44 43 32.0106132783 -1.30050393018 34.3111172085 1.30050393018
45 44 33.2666740896 -1.34056276039 35.60723685 1.34056276039
46 45 34.5340985324 -1.37720333844 36.9113018708 1.37720333844
47 46 35.8126340812 -1.41006157984 38.2226956611 1.41006157984
48 47 37.1020391905 -1.43881558247 39.540854773 1.43881558247
49 48 38.4020825932 -1.46318686714 40.8652694604 1.46318686714
50 49 39.7125426588 -1.48294129738 42.1954839562 1.48294129738
51 50 41.0332068028 -1.49788968556 43.5310964884 1.49788968556
52 51 42.3638709442 -1.5078880931 44.8717590373 1.5078880931
53 52 43.704339005 -1.51283783312 46.2171768381 1.51283783312
54 53 45.0544224487 -1.5126851846 47.5671076334 1.5126851846
55 54 46.4139398536 -1.50742082787 48.9213606815 1.50742082787
56 55 47.7827165168 -1.4970790118 50.2797955286 1.4970790118
57 56 49.1605840886 -1.4817364643 51.6423205529 1.4817364643
58 57 50.5473802314 -1.46151105783 53.0088912892 1.46151105783
59 58 51.9429483038 -1.43656024314 54.379508547 1.43656024314
60 59 53.3471370658 -1.40707926447 55.7542163303 1.40707926447
61 60 54.7598004042 -1.37329917068 57.1330995749 1.37329917068
62 61 56.180797076 -1.33548463712 58.5162817131 1.33548463712
63 62 57.6099904692 -1.29393161387 59.9039220831 1.29393161387
64 63 59.0472483787 -1.2489648163 61.296213195 1.2489648163
65 64 60.4924427963 -1.20093507465 62.693377871 1.20093507465
66 65 61.9454497141 -1.15021655963 64.0956662737 1.15021655963
67 66 63.4061489397 -1.09720390128 65.503352841 1.09720390128
68 67 64.8744239231 -1.04230921902 66.9167331421 1.04230921902
69 68 66.3501615931 -0.985959080503 68.3361206736 0.985959080503
70 69 67.8332522044 -0.928591407438 69.7618436118 0.928591407438
71 70 69.3235891926 -0.870652346445 71.1942415391 0.870652346445
72 71 70.8210690381 -0.812593122934 72.633662161 0.812593122934
73 72 72.3255911371 -0.754866896008 74.0804580331 0.754866896008
74 73 73.8370576806 -0.697925632096 75.5349833127 0.697925632096
75 74 75.3553735393 -0.642217014826 76.9975905541 0.642217014826
76 75 76.8804461547 -0.588181408245 78.4686275629 0.588181408245
77 76 78.4121854368 -0.536248890084 79.9484343269 0.536248890084
78 77 79.9505036663 -0.486836371259 81.4373400375 0.486836371259
79 78 81.4953154023 -0.440344817188 82.9356602195 0.440344817188
80 79 83.0465373947 -0.397156585875 84.4436939806 0.397156585875
81 80 84.604088501 -0.357632896962 85.961721398 0.357632896962
82 81 86.1678896073 -0.322111445159 87.4900010525 0.322111445159
83 82 87.7378635532 -0.290904170601 89.0287677238 0.290904170601
84 83 89.31393506 -0.264295197777 90.5782302578 0.264295197777
85 84 90.8960306632 -0.242538953685 92.1385696169 0.242538953685
86 85 92.4840786473 -0.22585847485 93.7099371222 0.22585847485
87 86 94.0780089844 -0.214443911803 95.2924528962 0.214443911803
88 87 95.6777532749 -0.20845123847 96.8862045134 0.20845123847
89 88 97.2832446919 -0.208001172823 98.4912458647 0.208001172823
90 89 98.8944179271 -0.213178313963 100.107596241 0.213178313963
91 90 100.51120914 -0.224030499608 101.735239639 0.224030499608
92 91 102.133555908 -0.24056838679 103.374124295 0.24056838679
93 92 103.761397182 -0.262765257305 105.024162439 0.262765257305
94 93 105.394673238 -0.290557048288 106.685230286 0.290557048288
95 94 107.033325638 -0.323842607042 108.357168245 0.323842607042
96 95 108.677297188 -0.362484168062 110.039781356 0.362484168062
97 96 110.326531895 -0.406308048983 111.732839944 0.406308048983
98 97 111.980974936 -0.455105561037 113.436080497 0.455105561037
99 98 113.640572615 -0.508634128436 115.149206744 0.508634128436
100 99 115.305272336 -0.566618609996 116.871890946 0.566618609996
101 100 116.975022562 -0.628752815248 118.603775377 0.628752815248
102 101 118.649772787 -0.694701206228 120.344473993 0.694701206228
103 102 120.329473508 -0.764100775187 122.093574283 0.764100775187
104 103 122.014076189 -0.8365630875 123.850639277 0.8365630875
105 104 123.70353324 -0.911676478197 125.615209718 0.911676478197
106 105 125.397797982 -0.989008389739 127.386806372 0.989008389739
107 106 127.09682463 -1.06810783788 129.164932468 1.06810783788
108 107 128.800568258 -1.14850799181 130.94907625 1.14850799181
109 108 130.508984784 -1.22972885422 132.738713638 1.22972885422
110 109 132.22203094 -1.31128002627 134.533310966 1.31128002627
111 110 133.939664251 -1.3926635421 136.332327793 1.3926635421
112 111 135.661843017 -1.47337675727 138.135219774 1.47337675727
113 112 137.388526287 -1.55291527482 139.941441562 1.55291527482
114 113 139.119673843 -1.63077589305 141.750449736 1.63077589305
115 114 140.855246178 -1.70645955844 143.561705737 1.70645955844
116 115 142.595204478 -1.77947430748 145.374678786 1.77947430748
117 116 144.339510604 -1.849338181 147.188848785 1.849338181
118 117 146.088127075 -1.91558209495 149.00370917 1.91558209495
119 118 147.84101705 -1.97775265161 150.818769701 1.97775265161
120 119 149.598144313 -2.03541487567 152.633559189 2.03541487567
121 120 151.359473257 -2.08815485988 154.447628117 2.08815485988
122 121 153.124968867 -2.13558230564 156.260551173 2.13558230564
123 122 154.894596709 -2.17733294414 158.071929653 2.17733294414
124 123 156.668322912 -2.21307082471 159.881393736 2.21307082471
125 124 158.446114155 -2.24249045726 161.688604612 2.24249045726
126 125 160.227937656 -2.26531879689 163.493256453 2.26531879689
127 126 162.013761157 -2.28131705926 165.295078216 2.28131705926
128 127 163.803552912 -2.29028235636 167.093835269 2.29028235636
129 128 165.597281676 -2.29204914321 168.889330819 2.29204914321
130 129 167.394916689 -2.28649046705 170.681407156 2.28649046705
131 130 169.196427671 -2.27351901152 172.469946682 2.27351901152
132 131 171.001784807 -2.25308792956 174.254872736 2.25308792956
133 132 172.810958736 -2.22519145965 176.036150196 2.22519145965
134 133 174.623920545 -2.18986532148 177.813785867 2.18986532148
135 134 176.440641752 -2.1471868879 179.58782864 2.1471868879
136 135 178.261094303 -2.09727513145 181.358369434 2.09727513145
137 136 180.085250557 -2.04029034492 183.125540902 2.04029034492
138 137 181.913083281 -1.97643363655 184.889516918 1.97643363655
139 138 183.744565641 -1.90594620153 186.650511843 1.90594620153
140 139 185.579671189 -1.82910837297 188.408779562 1.82910837297
141 140 187.41837386 -1.74623845632 190.164612316 1.74623845632
142 141 189.260647959 -1.65769135265 191.918339311 1.65769135265
143 142 191.106468157 -1.5638569771 193.670325134 1.5638569771
144 143 192.955809482 -1.46515848014 195.420967962 1.46515848014
145 144 194.80864731 -1.36205027997 197.17069759 1.36205027997
146 145 196.664957361 -1.25501591596 198.919973277 1.25501591596
147 146 198.524715688 -1.14456573329 200.669281421 1.14456573329
148 147 200.387898672 -1.03123441053 202.419133083 1.03123441053
149 148 202.254483017 -0.915578342277 204.170061359 0.915578342277
150 149 204.12444574 -0.79817289002 205.92261863 0.79817289002
151 150 205.997764168 -0.679609514968 207.677373683 0.679609514968
152 151 207.874415929 -0.560492807364 209.434908736 0.560492807364
153 152 209.754378948 -0.4414374273 211.195816375 0.4414374273
154 153 211.637631441 -0.323064972571 212.960696414 0.323064972571
155 154 213.524151908 -0.206000789552 214.730152698 0.206000789552
156 155 215.413919128 -0.0908707434141 216.504789872 0.0908707434141
157 156 217.306912155 0.0217020357471 218.285210119 0.0217020357471
158 157 219.20311031 0.131100414121 220.072009896 0.131100414121
159 158 221.102493178 0.236716505869 221.865776672 0.236716505869
160 159 223.005040603 0.33795489846 223.667085705 0.33795489846
161 160 224.910732682 0.434235834855 225.476496848 0.434235834855
162 161 226.819549762 0.524998335977 227.294551426 0.524998335977
163 162 228.731472431 0.609703247074 229.121769184 0.609703247074
164 163 230.64648152 0.687836191995 230.958645328 0.687836191995
165 164 232.564558094 0.758910419766 232.805647674 0.758910419766
166 165 234.485683448 0.822469528369 234.66321392 0.822469528369
167 166 236.409839105 0.878090051219 236.531749054 0.878090051219
168 167 238.337006811 0.925383892456 238.411622918 0.925383892456
169 168 240.267168528 0.964000597918 240.30316793 0.964000597918
170 169 242.200306436 0.993629449449 242.206676987 0.993629449449
171 170 244.136402924 1.01400137104 244.122401553 1.01400137104
172 171 246.075440588 1.02489063624 246.050549952 1.02489063624
173 172 248.017402229 1.02611636723 247.991285862 1.02611636723
174 173 249.962270847 1.01754381698 249.94472703 1.01754381698
175 174 251.910029638 0.999085427007 251.910944211 0.999085427007
176 175 253.860661992 0.970701654266 253.889960338 0.970701654266
177 176 255.814151489 0.932401562058 255.881749927 0.932401562058
178 177 257.770481895 0.884243170728 257.886238724 0.884243170728
179 178 259.72963716 0.826333565384 259.903303595 0.826333565384
180 179 261.691601414 0.758828758919 261.932772655 0.758828758919
181 180 263.656358964 0.68193330993 263.974425654 0.68193330993
182 181 265.623894291 0.595899696314 266.027994595 0.595899696314
183 182 267.59419205 0.501027446574 268.093164603 0.501027446574
184 183 269.567237061 0.397662032085 270.169575029 0.397662032085
185 184 271.543014313 0.286193524774 272.256820788 0.286193524774
186 185 273.521508956 0.167055025875 274.35445393 0.167055025875
187 186 275.502706301 0.0407208725615 276.461985429 0.0407208725615
188 187 277.486591819 -0.0922953695887 278.578887189 0.0922953695887
189 188 279.473151134 -0.231443119255 280.704594253 0.231443119255
190 189 281.462370023 -0.376137187069 282.83850721 0.376137187069
191 190 283.454234414 -0.525760367233 284.979994782 0.525760367233
192 191 285.448730385 -0.67966620102 287.128396586 0.67966620102
193 192 287.445844157 -0.837181899201 289.283026056 0.837181899201
194 193 289.445562095 -0.997611409621 291.443173505 0.997611409621
195 194 291.447870707 -1.16023861539 293.608109322 1.16023861539
196 195 293.452756638 -1.32433064846 295.777087287 1.32433064846
197 196 295.460206672 -1.48914130267 297.949347975 1.48914130267
198 197 297.470207727 -1.65391453 300.124122257 1.65391453
199 198 299.482746852 -1.81788800304 302.300634855 1.81788800304
200 199 301.49781123 -1.98029672647 304.478107957 1.98029672647
201 200 303.515388171 -2.14037668013 306.655764851 2.14037668013
202 201 305.535465112 -2.29736847579 308.832833588 2.29736847579
203 202 307.558029615 -2.45052100985 311.008550625 2.45052100985
204 203 309.583069366 -2.59909509412 313.18216446 2.59909509412
205 204 311.61057217 -2.74236704678 315.352939217 2.74236704678
206 205 313.640525956 -2.87963222583 317.520158181 2.87963222583
207 206 315.672918765 -3.01020848772 319.683127253 3.01020848772
208 207 317.707738759 -3.13343955386 321.841178313 3.13343955386
209 208 319.744974212 -3.2486982684 323.99367248 3.2486982684
210 209 321.784613511 -3.35538973099 326.140003242 3.35538973099
211 210 323.826645155 -3.45295428899 328.279599444 3.45295428899
212 211 325.871057751 -3.54087037391 330.411928125 3.54087037391
213 212 327.917840015 -3.618657168 332.536497183 3.618657168
214 213 329.96698077 -3.68587708736 334.652857857 3.68587708736
215 214 332.018468942 -3.74213806906 336.760607011 3.74213806906
216 215 334.072293564 -3.78709565046 338.859389214 3.78709565046
217 216 336.128443766 -3.82045483016 340.948898596 3.82045483016
218 217 338.186908784 -3.84197170077 343.028880484 3.84197170077
219 218 340.247677949 -3.85145484505 345.099132794 3.85145484505
220 219 342.310740691 -3.84876648788 347.159507179 3.84876648788
221 220 344.376086539 -3.8338233979 349.209909937 3.8338233979
222 221 346.443705115 -3.80659753369 351.250302648 3.80659753369
223 222 348.513586133 -3.76711643065 353.280702564 3.76711643065
224 223 350.585719404 -3.71546332611 355.30118273 3.71546332611
225 224 352.660094827 -3.65177702126 357.311871849 3.65177702126
226 225 354.736702394 -3.5762514799 359.312953873 3.5762514799
227 226 356.815532182 -3.48913516536 361.304667347 3.48913516536
228 227 358.89657436 -3.39073011797 363.287304478 3.39073011797
229 228 360.979819181 -3.28139077699 365.261209958 3.28139077699
230 229 363.065256984 -3.16152255193 367.226779536 3.16152255193
231 230 365.152878194 -3.03158014972 369.184458343 3.03158014972
232 231 367.242673316 -2.89206566489 371.134738981 2.89206566489
233 232 369.334632941 -2.7435264417 373.078159383 2.7435264417
234 233 371.428747738 -2.58655271771 375.015300456 2.58655271771
235 234 373.525008458 -2.42177505974 376.946783518 2.42177505974
236 235 375.62340593 -2.249861604 378.873267534 2.249861604
237 236 377.723931062 -2.0715151132 380.795446175 2.0715151132
238 237 379.826574837 -1.88746986433 382.714044702 1.88746986433
239 238 381.931328318 -1.69848838171 384.629816699 1.69848838171
240 239 384.038182638 -1.50535803048 386.543540669 1.50535803048
241 240 386.147129009 -1.30888748671 388.456016496 1.30888748671
242 241 388.258158713 -1.10990310055 390.368061814 1.10990310055
243 242 390.371263106 -0.909245169769 392.280508276 0.909245169769
244 243 392.486433615 -0.707764141124 394.194197756 0.707764141124
245 244 394.603661737 -0.506316757602 396.109978495 0.506316757602
246 245 396.722939039 -0.305762169793 398.028701209 0.305762169793
247 246 398.844257158 -0.106958029797 399.951215188 0.106958029797
248 247 400.967607797 0.0892434137655 401.878364383 0.0892434137655
249 248 403.092982727 0.281999201106 403.810983526 0.281999201106
250 249 405.220373786 0.470479508502 405.749894278 0.470479508502
251 250 407.349772878 0.653871439113 407.695901439 0.653871439113
252 251 409.481171969 0.831382739334 409.64978923 0.831382739334
253 252 411.614563093 1.00224542299 411.61231767 1.00224542299
254 253 413.749938343 1.16571928613 413.584219057 1.16571928613
255 254 415.887289878 1.3210952956 415.566194583 1.3210952956
256 255 418.026609917 1.46769883537 417.558911082 1.46769883537
257 256 420.16789074 1.60489279505 419.562997945 1.60489279505
258 257 422.311124688 1.73208048586 421.579044203 1.73208048586
259 258 424.456304162 1.84870837032 423.607595792 1.84870837032
260 259 426.60342162 1.95426859244 425.649153027 1.95426859244
261 260 428.75246958 2.04830129657 427.704168283 2.04830129657
262 261 430.903440617 2.13039672375 429.773043893 2.13039672375
263 262 433.056327362 2.20019707566 431.856130287 2.20019707566
264 263 435.211122505 2.25739813736 433.953724368 2.25739813736
265 264 437.367818788 2.30175065104 436.066068137 2.30175065104
266 265 439.526409011 2.33306143443 438.193347576 2.33306143443
267 266 441.686886026 2.35119423853 440.335691788 2.35119423853
268 267 443.84924274 2.35607034063 442.4931724 2.35607034063
269 268 446.013472114 2.34766887007 444.665803244 2.34766887007
270 269 448.179567159 2.3260268651 446.853540294 2.3260268651
271 270 450.34752094 2.29123906082 449.05628188 2.29123906082
272 271 452.517326574 2.24345740932 451.273869164 2.24345740932
273 272 454.688977225 2.18289033448 453.506086891 2.18289033448
274 273 456.862466112 2.10980172509 455.752664387 2.10980172509
275 274 459.037786501 2.02450967139 458.013276829 2.02450967139
276 275 461.214931707 1.92738495105 460.287546756 1.92738495105
277 276 463.393895095 1.81884927223 462.575045823 1.81884927223
278 277 465.574670077 1.69937328205 464.875296795 1.69937328205
279 278 467.757250114 1.5694743504 467.187775763 1.5694743504
280 279 469.941628711 1.42971413973 469.511914571 1.42971413973
281 280 472.127799423 1.28069597258 471.847103451 1.28069597258
282 281 474.31575585 1.12306200978 474.19269384 1.12306200978
283 282 476.505491636 0.957490252832 476.548001383 0.957490252832
284 283 478.697000471 0.784691385001 478.912309086 0.784691385001
285 284 480.890276091 0.605405466442 481.284870625 0.605405466442
286 285 483.085312275 0.420398499231 483.664913776 0.420398499231
287 286 485.282102844 0.2304588789 486.051643965 0.2304588789
288 287 487.480641665 0.0363937495509 488.444247916 0.0363937495509
289 288 489.680922647 -0.160974719919 490.841897367 0.160974719919
290 289 491.882939739 -0.360813120595 493.24375286 0.360813120595
291 290 494.086686936 -0.562280631155 495.648967567 0.562280631155
292 291 496.29215827 -0.764532869994 498.05669114 0.764532869994
293 292 498.499347817 -0.966725753391 500.466073571 0.966725753391
294 293 500.708249693 -1.16801934133 502.876269035 1.16801934133
295 294 502.918858054 -1.36758165257 505.286439707 1.36758165257
296 295 505.131167095 -1.56459243086 507.695759526 1.56459243086
297 296 507.345171051 -1.75824684431 510.103417896 1.75824684431
298 297 509.560864197 -1.9477591005 512.508623297 1.9477591005
299 298 511.778240844 -2.13236596 514.910606804 2.13236596
300 299 513.997295343 -2.31133013199 517.308625475 2.31133013199
301 300 516.218022084 -2.48394353573 519.701965619 2.48394353573
302 301 518.44041549 -2.64953041275 522.089945903 2.64953041275
303 302 520.664470027 -2.80745027516 524.471920302 2.80745027516
304 303 522.890180193 -2.95710067627 526.847280869 2.95710067627
305 304 525.117540523 -3.09791979083 529.215460314 3.09791979083
306 305 527.346545591 -3.2293887929 531.575934384 3.2293887929
307 306 529.577190003 -3.35103402051 533.928224023 3.35103402051
308 307 531.809468401 -3.46242891731 536.271897319 3.46242891731
309 308 534.043375464 -3.56319574251 538.606571207 3.56319574251
310 309 536.278905904 -3.65300704149 540.931912946 3.65300704149
311 310 538.516054467 -3.73158687081 543.247641338 3.73158687081
312 311 540.754815933 -3.7987117724 545.553527706 3.7987117724
313 312 542.995185116 -3.85421149309 547.849396609 3.85421149309
314 313 545.237156863 -3.89796944663 550.13512631 3.89796944663
315 314 547.480726055 -3.92992291712 552.410648972 3.92992291712
316 315 549.725887603 -3.95006300337 554.675950606 3.95006300337
317 316 551.972636452 -3.95843430562 556.931070758 3.95843430562
318 317 554.22096758 -3.9551343569 559.176101937 3.9551343569
319 318 556.470875995 -3.94031280269 561.411188798 3.94031280269
320 319 558.722356737 -3.91417033376 563.636527071 3.91417033376
321 320 560.975404878 -3.87695737833 565.852362256 3.87695737833
322 321 563.230015518 -3.82897256075 568.058988079 3.82897256075
323 322 565.48618379 -3.77056093512 570.256744726 3.77056093512
324 323 567.743904858 -3.70211200325 572.446016861 3.70211200325
325 324 570.003173913 -3.6240575276 574.627231441 3.6240575276
326 325 572.263986179 -3.53686915059 576.800855329 3.53686915059
327 326 574.526336905 -3.44105583271 578.967392738 3.44105583271
328 327 576.790221374 -3.33716112282 581.127382497 3.33716112282
329 328 579.055634895 -3.22576027457 583.28139517 3.22576027457
330 329 581.322572807 -3.10745722384 585.43003003 3.10745722384
331 330 583.591030475 -2.98288144269 587.573911917 2.98288144269
332 331 585.861003294 -2.85268468572 589.71368798 2.85268468572
333 332 588.132486688 -2.71753764547 591.850024333 2.71753764547
334 333 590.405476106 -2.57812653373 593.983602639 2.57812653373
335 334 592.679967025 -2.43514960603 596.115116631 2.43514960603
336 335 594.95595495 -2.28931364675 598.245268597 2.28931364675
337 336 597.233435413 -2.14133043257 600.374765845 2.14133043257
338 337 599.51240397 -1.99191319177 602.504317162 1.99191319177
339 338 601.792856208 -1.84177307732 604.634629285 1.84177307732
340 339 604.074787735 -1.69161567098 606.766403406 1.69161567098
341 340 606.358194188 -1.54213753604 608.900331725 1.54213753604
342 341 608.64307123 -1.39402283552 611.037094066 1.39402283552
343 342 610.929414548 -1.24794003269 613.17735458 1.24794003269
344 343 613.217219853 -1.10453868995 615.321758543 1.10453868995
345 344 615.506482885 -0.964446381931 617.470929267 0.964446381931
346 345 617.797199405 -0.828265737692 619.625465143 0.828265737692
347 346 620.0893652 -0.696571626545 621.785936827 0.696571626545
348 347 622.382976082 -0.569908501016 623.952884583 0.569908501016
349 348 624.678027887 -0.448787909759 626.126815796 0.448787909759
350 349 626.974516473 -0.33368619232 628.308202665 0.33368619232
351 350 629.272437723 -0.225042366677 630.49748009 0.225042366677
352 351 631.571787545 -0.123256219508 632.695043765 0.123256219508
353 352 633.872561869 -0.0286866080757 634.901248477 0.0286866080757
354 353 636.174756647 0.0583500184838 637.116406628 0.0583500184838
355 354 638.478367855 0.13758087179 639.340786984 0.13758087179
356 355 640.783391493 0.208777845266 641.574613648 0.208777845266
357 356 643.089823582 0.271758299291 643.818065283 0.271758299291
358 357 645.397660165 0.326385607344 646.071274558 0.326385607344
359 358 647.706897309 0.372569461251 648.334327847 0.372569461251
360 359 650.0175311 0.410265934882 650.607265165 0.410265934882
361 360 652.329557649 0.43947730686 652.890080342 0.43947730686
362 361 654.642973087 0.460251644079 655.182721443 0.460251644079
363 362 656.957773566 0.472682149043 657.485091417 0.472682149043
364 363 659.273955261 0.476906275231 659.797048986 0.476906275231
365 364 661.591514367 0.473104615858 662.118409751 0.473104615858
366 365 663.910447098 0.461499572557 664.448947526 0.461499572557
367 366 666.230749693 0.442353811626 666.788395882 0.442353811626
368 367 668.552418408 0.415968516514 669.136449892 0.415968516514
369 368 670.875449521 0.382681446291 671.492768075 0.382681446291
370 369 673.19983933 0.342864810785 673.856974519 0.342864810785
371 370 675.525584152 0.296922973999 676.228661178 0.296922973999
372 371 677.852680325 0.245289998267 678.607390327 0.245289998267
373 372 680.181124207 0.188427042425 680.992697165 0.188427042425
374 373 682.510912176 0.126819627951 683.384092548 0.126819627951
375 374 684.842040626 0.0609747877213 685.781065839 0.0609747877213
376 375 687.174505976 -0.00858188741421 688.183087863 0.00858188741421
377 376 689.508304658 -0.0813092885446 690.589613947 0.0813092885446
378 377 691.843433128 -0.156653898971 693.000087027 0.156653898971
379 378 694.179887858 -0.234052958393 695.413940816 0.234052958393
380 379 696.517665339 -0.312937664315 697.830603003 0.312937664315
381 380 698.856762081 -0.392736393791 700.249498475 0.392736393791
382 381 701.197174613 -0.472877928588 702.670052542 0.472877928588
383 382 703.538899481 -0.552794666828 705.091694148 0.552794666828
384 383 705.881933249 -0.63192580426 707.513859053 0.63192580426
385 384 708.2262725 -0.709720468537 709.935992969 0.709720468537
386 385 710.571913835 -0.785640790079 712.357554625 0.785640790079
387 386 712.918853871 -0.859164893516 714.778018765 0.859164893516
388 387 715.267089244 -0.929789794075 717.196879038 0.929789794075
389 388 717.616616606 -0.997034183851 719.61365079 0.997034183851
390 389 719.967432628 -1.06044109343 722.027873722 1.06044109343
391 390 722.319533998 -1.11958041502 724.439114413 1.11958041502
392 391 724.672917418 -1.17405127405 726.846968692 1.17405127405
393 392 727.027579611 -1.22348423677 729.251063848 1.22348423677
394 393 729.383517314 -1.26754334261 731.651060657 1.26754334261
395 394 731.740727282 -1.30592795056 734.046655232 1.30592795056
396 395 734.099206285 -1.33837439021 736.437580675 1.33837439021
397 396 736.458951111 -1.36465740876 738.82360852 1.36465740876
398 397 738.819958563 -1.38459140657 741.20454997 1.38459140657
399 398 741.182225461 -1.39803145501 743.580256917 1.39803145501
400 399 743.545748641 -1.40487409117 745.950622732 1.40487409117
401 400 745.910524953 -1.40505788548 748.315582839 1.40505788548
402 401 748.276551266 -1.3985637794 750.675115045 1.3985637794
403 402 750.643824461 -1.38541519136 753.029239652 1.38541519136
404 403 753.012341437 -1.36567789053 755.378019328 1.36567789053
405 404 755.382099108 -1.33945963916 757.721558747 1.33945963916
406 405 757.753094403 -1.3069096054 760.060004009 1.3069096054
407 406 760.125324266 -1.26821754962 762.393541815 1.26821754962
408 407 762.498785656 -1.2236127887 764.722398444 1.2236127887
409 408 764.873475547 -1.17336294358 767.04683849 1.17336294358
410 409 767.249390928 -1.11777247674 769.367163405 1.11777247674
411 410 769.626528803 -1.05718102718 771.68370983 1.05718102718
412 411 772.00488619 -0.991961551779 773.996847742 0.991961551779
413 412 774.384460123 -0.922518282536 776.306978405 0.922518282536
414 413 776.765247647 -0.849284510618 778.614532158 0.849284510618
415 414 779.147245826 -0.772720208632 780.919966034 0.772720208632
416 415 781.530451733 -0.693309503651 783.223761237 0.693309503651
417 416 783.914862461 -0.611558014183 785.526420475 0.611558014183
418 417 786.300475111 -0.527990065017 787.828465176 0.527990065017
419 418 788.687286802 -0.443145794538 790.130432596 0.443145794538
420 419 791.075294665 -0.357578169644 792.432872834 0.357578169644
421 420 793.464495845 -0.271849923902 794.736345769 0.271849923902
422 421 795.854887502 -0.186530435001 797.041417937 0.186530435001
423 422 798.246466807 -0.102192557869 799.348659365 0.102192557869
424 423 800.639230947 -0.0194094300798 801.658640377 0.0194094300798
425 424 803.033177119 0.0612487336659 803.971928385 0.0612487336659
426 425 805.428302537 0.139217841136 806.289084696 0.139217841136
427 426 807.824604425 0.213943099384 808.610661326 0.213943099384
428 427 810.222080022 0.284882152055 810.93719787 0.284882152055
429 428 812.62072658 0.351508160601 813.269218419 0.351508160601
430 429 815.020541362 0.413312813136 815.607228548 0.413312813136
431 430 817.421521644 0.469809244968 817.9517124 0.469809244968
432 431 819.823664718 0.520534855325 820.303129863 0.520534855325
433 432 822.226967884 0.56505400526 822.661913879 0.56505400526
434 433 824.631428458 0.602960582365 825.028467876 0.602960582365
435 434 827.037043766 0.633880418534 827.403163348 0.633880418534
436 435 829.443811148 0.657473547793 829.786337601 0.657473547793
437 436 831.851727956 0.673436292008 832.178291664 0.673436292008
438 437 834.260791552 0.681503163134 834.579288389 0.681503163134
439 438 836.670999313 0.681448571609 836.989550741 0.681448571609
440 439 839.082348626 0.673088331481 839.409260295 0.673088331481
441 440 841.494836892 0.656280953867 841.838555938 0.656280953867
442 441 843.908461521 0.63092872143 844.2775328 0.63092872143
443 442 846.323219938 0.596978537678 846.7262414 0.596978537678
444 443 848.739109575 0.554422546003 849.184687029 0.554422546003
445 444 851.156127881 0.503298514594 851.652829367 0.503298514594
446 445 853.574272314 0.443689984513 854.130582329 0.443689984513
447 446 855.993540341 0.375726179455 856.617814162 0.375726179455
448 447 858.413929445 0.299581676926 859.114347768 0.299581676926
449 448 860.835437117 0.215475841773 861.619961276 0.215475841773
450 449 863.258060861 0.123672024269 864.134388837 0.123672024269
451 450 865.68179819 0.0244765260965 866.657321664 0.0244765260965
452 451 868.106646631 -0.0817626611738 869.188409292 0.0817626611738
453 452 870.532603718 -0.194657339377 871.727261058 0.194657339377
454 453 872.959667001 -0.31378080193 874.273447803 0.31378080193
455 454 875.387834036 -0.43866973889 876.826503775 0.43866973889
456 455 877.817102393 -0.568826339826 879.385928733 0.568826339826
457 456 880.247469651 -0.703720584402 881.951190236 0.703720584402
458 457 882.678933401 -0.842792709601 884.52172611 0.842792709601
459 458 885.111491242 -0.985455841576 887.096947083 0.985455841576
460 459 887.545140786 -1.13109877928 889.676239565 1.13109877928
461 460 889.979879655 -1.27908891619 892.258968571 1.27908891619
462 461 892.41570548 -1.42877528575 894.844480766 1.42877528575
463 462 894.852615904 -1.57949171542 897.432107619 1.57949171542
464 463 897.290608579 -1.7305600738 900.021168653 1.7305600738
465 464 899.729681168 -1.88129359449 902.610974762 1.88129359449
466 465 902.169831343 -2.03100026029 905.200831603 2.03100026029
467 466 904.611056787 -2.1789862307 907.790043017 2.1789862307
468 467 907.053355192 -2.32455929553 910.377914487 2.32455929553
469 468 909.496724261 -2.4670323374 912.963756598 2.4670323374
470 469 911.941161706 -2.60572678538 915.546888491 2.60572678538
471 470 914.386665249 -2.73997604274 918.126641291 2.73997604274
472 471 916.833232622 -2.86912887103 920.702361493 2.86912887103
473 472 919.280861566 -2.99255271361 923.273414279 2.99255271361
474 473 921.729549832 -3.10963694156 925.839186773 3.10963694156
475 474 924.17929518 -3.21979600548 928.399091186 3.21979600548
476 475 926.630095381 -3.32247247693 930.952567858 3.32247247693
477 476 929.081948213 -3.41713996405 933.499088177 3.41713996405
478 477 931.534851466 -3.50330588612 936.038157352 3.50330588612
479 478 933.988802936 -3.5805140929 938.569317029 3.5805140929
480 479 936.443800432 -3.648347315 941.092147747 3.648347315
481 480 938.899841769 -3.70642943251 943.606271202 3.70642943251
482 481 941.356924773 -3.75442754999 946.111352323 3.75442754999
483 482 943.815047277 -3.79205386673 948.607101144 3.79205386673
484 483 946.274207127 -3.81906733245 951.093274459 3.81906733245
485 484 948.734402172 -3.8352750793 953.569677252 3.8352750793
486 485 951.195630276 -3.84053362248 956.036163899 3.84053362248
487 486 953.657889308 -3.83474982261 958.49263913 3.83474982261
488 487 956.121177146 -3.81788160443 960.93905875 3.81788160443
489 488 958.585491678 -3.78993842738 963.375430105 3.78993842738
490 489 961.0508308 -3.75098150499 965.801812305 3.75098150499
491 490 963.517192417 -3.70112377119 968.218316188 3.70112377119
492 491 965.984574443 -3.64052959289 970.625104035 3.64052959289
493 492 968.452974798 -3.56941422947 973.022389027 3.56941422947
494 493 970.922391413 -3.48804304105 975.410434454 3.48804304105
495 494 973.392822228 -3.39673044873 977.789552676 3.39673044873
496 495 975.864265188 -3.29583865107 980.160103839 3.29583865107
497 496 978.336718249 -3.18577610251 982.522494351 3.18577610251
498 497 980.810179374 -3.0669957604 984.877175134 3.0669957604
499 498 983.284646536 -2.93999310869 987.224639644 2.93999310869
500 499 985.760117714 -2.80530396723 989.565421681 2.80530396723
501 500 988.236590895 -2.66350209695 991.900092992 2.66350209695

E-021-sinf-sf-curve.json — 1.2 KB, updated 08-19-2026

JSON sidecar (click to expand)
{
  "experiment": "E-021",
  "task": "3.7: exact S_inf(n) + |S_f(n)| curve + D-036 constants",
  "script": "research/numerics/scripts/E-021-sinf-sf-curve.py",
  "parameters": {
    "n_max": 5000,
    "t_zeros": 5000.0
  },
  "checks": {
    "V1_lambda_vs_E015": true,
    "V2_R_bound_holds": true,
    "V3_Sinf_residual_bounded": true
  },
  "key_values": {
    "A_use": 0.9,
    "B0_use": 1.0,
    "R_max_sample": 4.7507714994958565,
    "C0_samples": {
      "1e2": 6.234438640727731,
      "1e4": 8.840233256550178,
      "1e6": 11.194201354663145
    },
    "eta_0": "-0.5772156649015328606065120900824024310",
    "Sinf_residual_fits": [
      [
        1000,
        -0.2500416666625
      ],
      [
        2000,
        -0.2500208333328125
      ],
      [
        3000,
        -0.25001388888873455
      ],
      [
        4000,
        -0.25001041666660156
      ],
      [
        5000,
        -0.2500083333333
      ]
    ],
    "V1_worst_rel": 4.79820218420929e-25,
    "S_f_max_abs": "13.5229134371",
    "S_f_max_abs_n": 3298
  },
  "elapsed_seconds": 2139.3,
  "timestamp_utc": "2026-08-19T06:48:55.463113+00:00"
}

Source code

Python script (click to expand)
"""E-021 — task 3.7: exact S_inf(n) to n=1e4, |S_f(n)| curve, tightened
D-036 constants. Feeds D-037 (finite-height Li theorem).

Components:
  P1. D-036 constants: C0(t) from Trudgian; |R(s)| = |zeta'/zeta(s) -
      sum_{|gamma-t|<1} 1/(s-rho)| sampled at ~30 contour points (flint
      acb zeta + fd derivative, zeros via mp.zetazero) -> fit A, B0.
  P2. eta_j — ALL FLINT (session 006 cont.10 root-cause: mpmath zeta,
      Hurwitz included, silently loses accuracy beyond ~58 digits on
      this stack [mpmath 1.3 + Py 3.14] -> eta_j errors ~1e-58 ->
      S_f binomial cancellation explodes ~(4/3)^n; V1 failed 1.4e143.
      The zero-side sigma route also has eta_0 wrong by 2.4e-4 from
      sigma_1 truncation at T=5000 — both defects removed here).
      j <= 23: Stieltjes series division (E-011 machinery, validated):
        -zeta'/zeta(1+u) = (1/u) N(u)/D(u), eta_k = [u^{k+1}] N/D.
      j >= 24: Lagarias (4.10) with flint arb zeta:
        eta_j = (-1)^{j+1} [(1-2^{-(j+1)}) zeta(j+1) - 1 + sigma_{j+1}]
        with sigma_m = (-1)^{m-1}(tau_{m-1} - eta_{m-1}) + 1 EXACT
        (arithmetic side) for m <= 24, and sigma_m = 2 Re sum
        rho^{-m} over the first 100 zeros (mp.zetazero, dps 100)
        for 25 <= m <= M_SIG; omitted beyond (boundary error
        C(n,M_SIG)*14^{-M_SIG} < 1e-40 by construction).
      NOTES (hard-won, session 006 cont.10):
      * sigma_m may NOT be omitted at any m <= M_SIG — the truncation
        boundary error ~ C(n,M)*14^{-M} PEAKS at M = n/15 with size
        ~(15/14)^n: with M=200, S_f exploded as 1e133 at n=5000
        (measured). M_SIG ~ 0.22*n_max.
      * the m=24 omission alone moved S_f(200) by ~0.4 (measured).
      * float64 zeros for sigma_m are NOT enough either (S_f(300) off
        by 7.8e-8 — measured); need mp.zetazero precision. Zeros
        k > 100 contribute < (14.13/236.5)^25 ~ 1e-31 relative for
        m >= 25, so the first 100 at dps 100 are effectively exact.
      * GAMMA_E must be a string (bare float -> 53-bit, 4.94e-21).
  P3. S_inf(n) EXACT for n <= N_MAX (Lagarias (4.11)):
        S_inf(n) = sum_{j=1}^n (-1)^j C(n,j) (1-2^{-j}) zeta*(j),
        zeta*(1) = log(4pi)+gamma, zeta*(j) = zeta(j) (flint.arb).
      Cancellation ~2^n -> dps = ceil(0.31*n) + 60.
  P4. S_f(n) = sum_{j=1}^n C(n,j) eta_{j-1} (plain binomial — the
      E-011/Lagarias-(4.13) convention after the (-1) absorbed into
      the series-eta definition; VALIDATED: S_f(200) = -2.14037668
      matches S_inf(200)+1-lambda_200(E-015)); lambda_n =
      S_inf - S_f + 1.
  P5. VALIDATION: lambda_n (n <= 3000) vs E-015 certified CSV (rel dev);
      eta_0 vs E-011 value; S_inf fit: S_inf - [(1/2)n log n + C1 n]
      -> c0 (+ c1/n...), C1 = (gamma-1-log(2pi))/2.

Checks:
  V1. lambda_n matches E-015 for n <= 3000 (rel dev < 1e-50 at dps used).
  V2. |R(s)| <= A log(t+2) + B0 at all sample points with the FITTED
      A, B0 (and fitted values reported vs D-036's 2.0/2.0).
  V3. S_inf fit residual -> constant c0 (|residual - c0| -> 0 trend).

Outputs: research/numerics/data/E-021-sinf-sf-curve.csv (+ .json)
"""
import json
import sys
import time
from datetime import datetime, timezone
from pathlib import Path

import flint
import mpmath as mp
import numpy as np

REPO = Path(__file__).resolve().parents[3]
DATA = REPO / "research" / "numerics" / "data"
CSV = DATA / "E-021-sinf-sf-curve.csv"
JSON = DATA / "E-021-sinf-sf-curve.json"
E015 = DATA / "E-015-li-coefficients-n3000.csv"

N_MAX = 5000            # 10000 costs ~2h (row cost ~ n^2 * dps);
                        # cached zeta/zeros make a later 1e4 rerun cheap
T_ZEROS = 5000.0        # zeros up to this height for sigma sums
N_ZMAX = 8000           # mp.zetazero count cap (N(5e3) ~ 7.9e3)
DPS_BIG = 3300
# NOTE: must be a STRING — a bare float literal collapses to 53-bit
# (measured error 4.94e-21 -> sigma_1/zeta*(1) wrong at digit 21).
GAMMA_E = "0.57721566490153286060651209008240243104215933593992337"


# ---------------------------------------------------------------- N(T)
def N_count(T):
    F = (T / (2 * np.pi)) * np.log(T / (2 * np.pi)) - T / (2 * np.pi) + 7 / 8
    return F


def S_bound(T):
    return 0.137 * np.log(T) + 0.443 * np.log(np.log(T)) + 1.588


def C0(t):
    """Upper bound for zeros in [t, t+1] (t >= 10)."""
    return (N_count(t + 1) - N_count(t)) + S_bound(t + 1) + S_bound(t)


# ------------------------------------------------------------- zeros
def compute_zeros():
    cache = DATA / "E-021-zeros-cache.npy"
    n_est = int(N_count(T_ZEROS) + S_bound(T_ZEROS)) + 100
    n_est = min(n_est, N_ZMAX)
    if cache.exists():
        zs = np.load(cache)
        if len(zs) >= n_est:
            print(f"  loaded {n_est} zeros from cache", flush=True)
            return zs[:n_est]
    print(f"  computing {n_est} zeros via mp.zetazero ...", flush=True)
    mp.mp.dps = 30
    zs = []
    for k in range(1, n_est + 1):
        zs.append(mp.zetazero(k).imag)
        if k % 1000 == 0:
            print(f"    {k}/{n_est}", flush=True)
    out = np.array([float(z) for z in zs])
    np.save(cache, out)
    return out


# ------------------------------------------------------- zeta strings
def get_zeta_strings(n_max):
    """zeta(j) decimal strings at full precision (flint arb), cached.
    full_digits = 0.31*n_max + 100 covers the ~2^n cancellation in
    BOTH S_inf and the (1-2^{-s})zeta(s)-1 eta formula (absolute
    error ~1e-1650 uniformly)."""
    full_digits = int(0.31 * n_max) + 100
    zcache = DATA / "E-021-zeta-cache.json"
    if zcache.exists():
        zeta_str = {int(k): v for k, v in
                    json.loads(zcache.read_text()).items()}
        print("  zeta strings loaded from cache", flush=True)
        # patch legacy zeta*(1) (built with double-precision GAMMA_E)
        mp.mp.dps = full_digits + 50
        z1 = mp.nstr(mp.log(4 * mp.pi) + mp.mpf(GAMMA_E), full_digits)
        if zeta_str.get(1) != z1:
            zeta_str[1] = z1
            zcache.write_text(json.dumps(zeta_str))
            print("  patched zeta*(1) in cache (GAMMA_E float fix)",
                  flush=True)
        return zeta_str, full_digits
    flint.ctx.prec = int(full_digits * 3.33) + 200
    mp.mp.dps = full_digits + 50
    zeta_str = {1: mp.nstr(mp.log(4 * mp.pi) + mp.mpf(GAMMA_E),
                           full_digits)}
    for j in range(2, n_max + 1):
        zeta_str[j] = flint.arb(j).zeta().str(full_digits,
                                              radius=False)
        if j % 2000 == 0:
            print(f"    zeta({j}) done", flush=True)
    zcache.write_text(json.dumps(zeta_str))
    return zeta_str, full_digits


# ---------------------------------------------------------------- eta
# K_SPLIT: eta_j for j < K_SPLIT from Stieltjes (exact, arithmetic);
# sigma_m exact for m <= K_SPLIT. Must be ~80: with K_SPLIT=24 the
# zero-tail (k>100) of sigma_25 entered at term j=24 with C(n,24)
# amplification — S_f(3000) was off by 1.06e3 growing ~n^24 (measured).
# With K_SPLIT=80 the zero-tail exposure (m>=81, k>100) is < 3e-11.
K_SPLIT = 80


def compute_eta(zeta_str, full_digits):
    """eta_j for j = 0..N_MAX-1, ALL flint-based (see header P2).
    Returns dict j -> decimal string at full_digits."""
    print(f"  eta_0..{K_SPLIT - 1}: flint Stieltjes + series division "
          "(E-011) ...", flush=True)
    flint.ctx.prec = int((full_digits + 100) * 3.33) + 200
    mp.mp.dps = full_digits + 100   # BEFORE mp.mpf(string) parses below!
    gam_s = [mp.mpf(flint.acb.stieltjes(k).real.str(
        full_digits + 100, radius=False)) for k in range(K_SPLIT + 2)]
    N_ = [mp.mpf(0)] * (K_SPLIT + 2)
    D_ = [mp.mpf(0)] * (K_SPLIT + 2)
    N_[0] = D_[0] = 1
    for m in range(0, K_SPLIT + 1):
        D_[m + 1] = (-1) ** m * gam_s[m] / mp.factorial(m)
    for m in range(1, K_SPLIT + 1):
        N_[m + 1] = -(-1) ** m * gam_s[m] / mp.factorial(m - 1)
    Ev = [mp.mpf(0)] * (K_SPLIT + 2)
    for k in range(0, K_SPLIT + 2):
        s = N_[k]
        for i in range(1, k + 1):
            s -= D_[i] * Ev[k - i]
        Ev[k] = s
    eta_str = {j: mp.nstr(Ev[j + 1], full_digits)
               for j in range(K_SPLIT)}
    print(f"    eta_0 = {mp.nstr(Ev[1], 15)} (should be -gamma)",
          flush=True)
    print(f"    eta_1 = {mp.nstr(Ev[2], 15)}", flush=True)

    # ---- sigma_m: exact (arithmetic) for m <= 24; zeros for 25..200
    print("  sigma_m: m<=24 exact (tau-eta), 25..200 from zeros ...",
          flush=True)
    mp.mp.dps = full_digits + 50
    tau = {0: mp.mpf(-0.5) * (mp.log(4 * mp.pi) + mp.mpf(GAMMA_E))}
    for j in range(1, K_SPLIT):
        z = mp.mpf(zeta_str[j + 1])
        tau[j] = (-1) ** (j + 1) * (1 - mp.mpf(2) ** (-(j + 1))) * z
    sigma = {}
    for m in range(1, K_SPLIT + 1):
        sigma[m] = ((-1) ** (m - 1)
                    * (tau[m - 1] - mp.mpf(eta_str[m - 1])) + 1)
    mp.mp.dps = 60
    sig1_known = 1 + mp.euler / 2 - mp.log(4 * mp.pi) / 2
    print(f"    sigma_1 = {mp.nstr(sigma[1], 20)} "
          f"(closed form {mp.nstr(sig1_known, 20)})", flush=True)
    # sigma_m, m = 25..M_SIG: first 100 zeros via mp.zetazero, dps 100.
    # M_SIG must be adaptive: truncating sigma at M leaves a boundary
    # error ~ C(n,M)*14.13^{-M} which PEAKS at M = n/15 (~(15/14)^n);
    # with M=200 the run exploded as 1e133 at n=5000 (measured). Need
    # C(n,M)*14^{-M} < 1e-40 on the decreasing side (M > n/15).
    # float64 zeros are NOT enough (S_f(300) off 7.8e-8 — measured);
    # zeros k>100 are suppressed by (14.13/236.5)^25 ~ 1e-31 relative.
    n_zeta = max(zeta_str)
    M_SIG = n_zeta
    for M in range(K_SPLIT + 1, n_zeta + 1):
        if M > n_zeta / 15:
            logC = (mp.loggamma(n_zeta + 1) - mp.loggamma(M + 1)
                    - mp.loggamma(n_zeta - M + 1))
            if float(logC - (M - 1) * mp.log(14.13)
                     + mp.log(0.05)) / np.log(10) < -40:
                M_SIG = M
                break
    print(f"    M_SIG = {M_SIG} (C(n,M)*14^{{-M}} < 1e-40)", flush=True)
    # sigma_m precision matters: dps-100 sums left eps_m ~ 14^{-m}e-100,
    # whose C(n,j)-amplified impact (peak term C(n,n/15)*14^{-n/15} ~
    # 1e105 at n=3000) showed up as S_f error ~1e3 (measured). Zeros
    # at 400 digits + sums at full_digits+50 kill it.
    # dps BEFORE any mp.mpf(string) parse! (Third instance of this bug
    # class: g100 parsed at leftover dps 60 corrupted sigma_m at
    # ~m*1e-60*14^{-m} -> S_f(3000) off by 1.7e7, growth ~n^80.)
    mp.mp.dps = full_digits + 50
    z100cache = DATA / "E-021-zeros100-hi-cache.json"
    if z100cache.exists():
        g100 = [mp.mpf(v) for v in
                json.loads(z100cache.read_text())]
    else:
        mp.mp.dps = 450
        g100 = [mp.zetazero(k).imag for k in range(1, 101)]
        z100cache.write_text(json.dumps([mp.nstr(g, 400)
                                         for g in g100]))
        mp.mp.dps = full_digits + 50
    rho = [mp.mpc(mp.mpf("0.5"), g) for g in g100]
    for m in range(K_SPLIT + 1, M_SIG + 1):
        sigma[m] = 2 * mp.re(sum(r ** (-m) for r in rho))
    mp.mp.dps = 60
    print(f"    sigma_2 = {mp.nstr(sigma[2], 20)}", flush=True)
    print(f"    sigma_25 (zeros) = {mp.nstr(sigma[25], 6)}; "
          f"sigma_{M_SIG} = {mp.nstr(sigma[M_SIG], 6)}", flush=True)

    print("  eta_j (j>=24): (-1)^{j+1}[(1-2^{-(j+1)})zeta(j+1) - 1 "
          "+ sigma_{j+1}] ...", flush=True)
    mp.mp.dps = full_digits + 50
    for j in range(K_SPLIT, n_zeta):
        z = mp.mpf(zeta_str[j + 1])
        sig = sigma[j + 1] if j + 1 <= M_SIG else mp.mpf(0)
        eta = (-1) ** (j + 1) * ((1 - mp.mpf(2) ** (-(j + 1))) * z - 1
                                 + sig)
        eta_str[j] = mp.nstr(eta, full_digits)
    # stitch check: eta_{K_SPLIT-1} via Stieltjes vs via full formula
    mp.mp.dps = full_digits + 50
    eta23_formula = ((-1) ** K_SPLIT
                     * ((1 - mp.mpf(2) ** (-K_SPLIT))
                        * mp.mpf(zeta_str[K_SPLIT])
                        - 1 + sigma[K_SPLIT]))
    stitch = abs(eta23_formula - mp.mpf(eta_str[K_SPLIT - 1]))
    mp.mp.dps = 60
    print(f"    stitch |eta_{K_SPLIT - 1} stieltjes - formula| = "
          f"{mp.nstr(stitch, 3)}", flush=True)
    return eta_str


# ----------------------------------------------------------- S_inf, Sf
def compute_S_inf(n_max, zeta_str, full_digits):
    """Exact S_inf(n) via zeta*(j) (flint arb), dps scaled by n.
    Cancellation ~2^n: every zeta(j) stored at FULL string precision
    (the Sigma(-1)^j C(n,j)*1 = 0 piece must cancel exactly)."""
    print("  parsing zeta strings once at full precision ...", flush=True)
    mp.mp.dps = full_digits + 50
    zeta_mpf = {j: mp.mpf(v) for j, v in zeta_str.items()}
    results = {}
    for n in range(1, n_max + 1):
        mp.mp.dps = int(0.31 * n) + 80
        s = mp.mpf(0)
        c = mp.mpf(1)
        for j in range(1, n + 1):
            c = c * (n - j + 1) / j          # C(n,j) by recurrence
            s += ((-1) ** j) * c * (1 - mp.mpf(2) ** (-j)) * zeta_mpf[j]
        results[n] = +s
        if n % 500 == 0:
            print(f"    S_inf row {n}/{n_max}", flush=True)
    return results


def compute_Sf(n_max, eta_str):
    """S_f(n) = sum_j C(n,j) eta_{j-1} — plain binomial (E-011/Lagarias
    (4.13) convention with series-eta; validated at n=200 vs E-015:
    S_f(200) = -2.14037668 = S_inf(200)+1-lambda_200). Requires eta_j
    absolute accuracy ~1e-1650 at n=5000 (terms C(n,j)*eta up to
    ~1e312 cancel to O(1)) — flint-only computation, see P2."""
    full_digits = int(0.31 * n_max) + 100
    mp.mp.dps = full_digits + 50
    eta_mpf = {j: mp.mpf(v) for j, v in eta_str.items()}
    results = {}
    for n in range(1, n_max + 1):
        mp.mp.dps = int(0.31 * n) + 80
        s = mp.mpf(0)
        c = mp.mpf(1)
        for j in range(1, n + 1):
            c = c * (n - j + 1) / j
            s += c * eta_mpf[j - 1]
        results[n] = +s
        if n % 500 == 0:
            print(f"    S_f row {n}/{n_max}", flush=True)
    return results


def main() -> int:
    if CSV.exists() and "--force" not in sys.argv:
        print(f"cached: {CSV} (use --force to recompute)")
        return 0
    t0 = time.time()

    # ---- P1: constants
    print("P1: D-036 constants ...", flush=True)
    print(f"  C0(100) = {C0(100):.3f}, C0(1e4) = {C0(1e4):.3f}, "
          f"C0(1e6) = {C0(1e6):.3f}", flush=True)
    gam_sample = compute_zeros()

    def xi_mp(s):
        return 0.5 * s * (s - 1) * mp.pi ** (-s / 2) * mp.gamma(s / 2) \
            * mp.zeta(s)

    def zeta_logder(s):
        """zeta'/zeta via xi'/xi minus explicit terms (mpmath dps 30;
        complex-zeta OK to ~1e-10 per E-018 C2)."""
        sm = mp.mpc(s.real, s.imag)
        xi_log = mp.diff(xi_mp, sm) / xi_mp(sm)
        return complex(xi_log - 1 / sm - 1 / (sm - 1)
                       + mp.mpf(0.5) * mp.log(mp.pi)
                       - mp.mpf(0.5) * mp.digamma(sm / 2))

    R_samples = []
    mp.mp.dps = 30
    for sig in (-2.5, 0.5, 3.0):
        for t in (10.0, 50.0, 100.0, 500.0, 1000.0):
            s = complex(sig, t)
            near = [g for g in gam_sample if abs(g - t) < 1.0]
            psum = sum(1.0 / (s - complex(0.5, g)) for g in near)
            R_samples.append((sig, t, abs(zeta_logder(s) - psum)))
    # fit |R| <= A log(t+2) + B0
    A_fit = max(v / np.log(t + 2) for _, t, v in R_samples)
    A_use = max(0.5, float(np.ceil(A_fit * 1.2 * 10) / 10))
    B0_need = max(v - A_use * np.log(t + 2) for _, t, v in R_samples)
    B0_use = max(1.0, float(np.ceil(B0_need * 1.3 * 10) / 10))
    print(f"  |R| max sample = {max(v for *_ , v in R_samples):.2f}; "
          f"A_use={A_use}, B0_use={B0_use}", flush=True)

    # ---- P2: zeta strings + eta (all flint)
    print("P2: zeta strings + eta_j (flint) ...", flush=True)
    zeta_str, full_digits = get_zeta_strings(N_MAX)
    eta_str = compute_eta(zeta_str, full_digits)

    # ---- P3/P4: S_inf, S_f
    print("P3: S_inf exact ...", flush=True)
    S_inf = compute_S_inf(N_MAX, zeta_str, full_digits)
    print("P4: S_f ...", flush=True)
    S_f = compute_Sf(N_MAX, eta_str)

    # ---- P5: validation + fit
    print("P5: validation vs E-015 ...", flush=True)
    e015 = {}
    with E015.open() as f:
        header = f.readline()
        for line in f:
            parts = line.strip().split(",")
            if len(parts) >= 2 and parts[0].isdigit():
                e015[int(parts[0])] = mp.mpf(parts[1])
    worst = 0.0
    mp.mp.dps = 100
    for n in sorted(e015):
        lam = S_inf[n] - S_f[n] + 1
        dev = abs(lam - e015[n]) / abs(e015[n])
        worst = max(worst, float(dev))
    print(f"  V1 worst rel dev vs E-015 (n<=3000): {worst:.2e}", flush=True)

    C1 = (mp.mpf(GAMMA_E) - 1 - mp.log(2 * mp.pi)) / 2
    fits = []
    for n in (1000, 2000, 3000, 4000, 5000, 6000, 8000, 10000):
        if n > N_MAX:
            continue
        mp.mp.dps = 100
        resid = S_inf[n] - (mp.mpf(n) / 2) * mp.log(n) - C1 * n
        fits.append((n, float(resid)))
    print(f"  S_inf residual (should -> c0): {fits}", flush=True)

    # ---- write CSV
    with CSV.open("w", encoding="utf-8", newline="") as f:
        f.write("n,S_inf,S_f,lambda_n,abs_Sf\n")
        for n in range(1, N_MAX + 1):
            lam = S_inf[n] - S_f[n] + 1
            f.write(f"{n},{mp.nstr(S_inf[n],12)},{mp.nstr(S_f[n],12)},"
                    f"{mp.nstr(lam,12)},{mp.nstr(abs(S_f[n]),12)}\n")

    checks = {
        # V1 floor is ~1e-24 (E-015 CSV holds 26 digits); 1e-15 still
        # kills any macroscopic (convention/precision) bug — the bugs
        # found in cont.10 produced 1e-8..1e143 deviations.
        "V1_lambda_vs_E015": bool(worst < 1e-15),
        "V2_R_bound_holds": bool(all(
            v <= A_use * np.log(t + 2) + B0_use for _, t, v in R_samples)),
        "V3_Sinf_residual_bounded": bool(
            abs(fits[-1][1] - fits[-2][1]) < abs(fits[0][1] - fits[1][1])),
    }
    meta = {
        "experiment": "E-021",
        "task": "3.7: exact S_inf(n) + |S_f(n)| curve + D-036 constants",
        "script": "research/numerics/scripts/E-021-sinf-sf-curve.py",
        "parameters": {"n_max": N_MAX, "t_zeros": T_ZEROS},
        "checks": checks,
        "key_values": {
            "A_use": A_use, "B0_use": B0_use,
            "R_max_sample": max(v for *_, v in R_samples),
            "C0_samples": {"1e2": C0(100), "1e4": C0(1e4), "1e6": C0(1e6)},
            "eta_0": eta_str[0][:40],
            "Sinf_residual_fits": fits,
            "V1_worst_rel": worst,
            "S_f_max_abs": mp.nstr(max(abs(S_f[n]) for n in S_f), 12),
            "S_f_max_abs_n": int(max(S_f, key=lambda k: abs(S_f[k]))),
        },
        "elapsed_seconds": round(time.time() - t0, 1),
        "timestamp_utc": datetime.now(timezone.utc).isoformat(),
    }
    JSON.write_text(json.dumps(meta, indent=2), encoding="utf-8")
    ok = all(checks.values())
    print(f"wrote {CSV.name}, {JSON.name} — "
          f"{'ALL CHECKS PASS' if ok else 'CHECK FAILURE: ' + str(checks)}")
    return 0 if ok else 1


if __name__ == "__main__":
    raise SystemExit(main())