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

← prev page 4 of 10 · 500/page · 5000 rows next →
# nS_infS_flambda_nabs_Sf
1502 1501 3792.19565755 -1.47420868592 3794.66986624 1.47420868592
1503 1502 3795.2224368 -1.41440925137 3797.63684605 1.41440925137
1504 1503 3798.24954894 -1.35767091759 3800.60721986 1.35767091759
1505 1504 3801.27699375 -1.30427111498 3803.58126487 1.30427111498
1506 1505 3804.30477101 -1.25445509675 3806.55922611 1.25445509675
1507 1506 3807.33288049 -1.20843451974 3809.54131501 1.20843451974
1508 1507 3810.36132198 -1.16638622626 3812.52770821 1.16638622626
1509 1508 3813.39009525 -1.12845123356 3815.51854649 1.12845123356
1510 1509 3816.41920009 -1.09473393644 3818.51393403 1.09473393644
1511 1510 3819.44863627 -1.06530152743 3821.5139378 1.06530152743
1512 1511 3822.47840358 -1.0401836377 3824.51858722 1.0401836377
1513 1512 3825.5085018 -1.01937220073 3827.527874 1.01937220073
1514 1513 3828.5389307 -1.00282153973 3830.54175224 1.00282153973
1515 1514 3831.56969007 -0.990448678274 3833.56013875 0.990448678274
1516 1515 3834.6007797 -0.982133872766 3836.58291357 0.982133872766
1517 1516 3837.63219935 -0.977721364006 3839.60992072 0.977721364006
1518 1517 3840.66394883 -0.977020343916 3842.64096917 0.977020343916
1519 1518 3843.6960279 -0.979806132444 3845.67583403 0.979806132444
1520 1519 3846.72843635 -0.985821558468 3848.7142579 0.985821558468
1521 1520 3849.76117396 -0.994778537456 3851.7559525 0.994778537456
1522 1521 3852.79424052 -1.00635983755 3854.80060036 1.00635983755
1523 1522 3855.82763582 -1.02022102479 3857.84785684 1.02022102479
1524 1523 3858.86135962 -1.0359925771 3860.8973522 1.0359925771
1525 1524 3861.89541173 -1.05328215592 3863.94869389 1.05328215592
1526 1525 3864.92979192 -1.07167702338 3867.00146895 1.07167702338
1527 1526 3867.96449998 -1.09074659205 3870.05524657 1.09074659205
1528 1527 3870.9995357 -1.11004509388 3873.10958079 1.11004509388
1529 1528 3874.03489885 -1.12911435382 3876.1640132 1.12911435382
1530 1529 3877.07058923 -1.14748665346 3879.21807588 1.14748665346
1531 1530 3880.10660662 -1.16468766921 3882.27129429 1.16468766921
1532 1531 3883.14295081 -1.18023946934 3885.32319028 1.18023946934
1533 1532 3886.17962158 -1.19366355356 3888.37328513 1.19366355356
1534 1533 3889.21661872 -1.20448391887 3891.42110264 1.20448391887
1535 1534 3892.25394202 -1.21223013503 3894.46617215 1.21223013503
1536 1535 3895.29159126 -1.21644041291 3897.50803168 1.21644041291
1537 1536 3898.32956624 -1.216664649 3900.54623089 1.216664649
1538 1537 3901.36786674 -1.21246742953 3903.58033417 1.21246742953
1539 1538 3904.40649255 -1.20343097758 3906.60992353 1.20343097758
1540 1539 3907.44544345 -1.18915802699 3909.63460148 1.18915802699
1541 1540 3910.48471925 -1.16927460722 3912.65399385 1.16927460722
1542 1541 3913.52431971 -1.1434327235 3915.66775244 1.1434327235
1543 1542 3916.56424465 -1.11131291749 3918.67555756 1.11131291749
1544 1543 3919.60449383 -1.07262669372 3921.67712052 1.07262669372
1545 1544 3922.64506706 -1.02711879827 3924.67218586 1.02711879827
1546 1545 3925.68596413 -0.974569336473 3927.66053346 0.974569336473
1547 1546 3928.72718481 -0.914795717372 3930.64198053 0.914795717372
1548 1547 3931.76872892 -0.847654413535 3933.61638333 0.847654413535
1549 1548 3934.81059623 -0.773042525645 3936.58363875 0.773042525645
1550 1549 3937.85278654 -0.690899142353 3939.54368568 0.690899142353
1551 1550 3940.89529963 -0.601206486835 3942.49650612 0.601206486835
1552 1551 3943.93813531 -0.503990842592 3945.44212615 0.503990842592
1553 1552 3946.98129336 -0.399323252135 3948.38061661 0.399323252135
1554 1553 3950.02477357 -0.287319983328 3951.31209356 0.287319983328
1555 1554 3953.06857575 -0.168142759361 3954.23671851 0.168142759361
1556 1555 3956.11269967 -0.0419987494852 3957.15469842 0.0419987494852
1557 1556 3959.15714514 0.0908596810998 3960.06628545 0.0908596810998
1558 1557 3962.20191194 0.230135462627 3962.97177648 0.230135462627
1559 1558 3965.24699987 0.375487552577 3965.87151232 0.375487552577
1560 1559 3968.29240873 0.526531905871 3968.76587682 0.526531905871
1561 1560 3971.3381383 0.682842680156 3971.65529562 0.682842680156
1562 1561 3974.38418839 0.843953671683 3974.54023472 0.843953671683
1563 1562 3977.43055879 1.0093599761 3977.42119881 1.0093599761
1564 1563 3980.47724929 1.1785198673 3980.29872942 1.1785198673
1565 1564 3983.52425968 1.35085688631 3983.1734028 1.35085688631
1566 1565 3986.57158977 1.52576213117 3986.04582764 1.52576213117
1567 1566 3989.61923935 1.7025967376 3988.91664261 1.7025967376
1568 1567 3992.66720821 1.88069453939 3991.78651368 1.88069453939
1569 1568 3995.71549616 2.05936489623 3994.65613126 2.05936489623
1570 1569 3998.76410298 2.23789567617 3997.5262073 2.23789567617
1571 1570 4001.81302848 2.41555637871 4000.3974721 2.41555637871
1572 1571 4004.86227244 2.59160138396 4003.27067106 2.59160138396
1573 1572 4007.91183468 2.76527331254 4006.14656137 2.76527331254
1574 1573 4010.96171498 2.93580648031 4009.0259085 2.93580648031
1575 1574 4014.01191315 3.10243043139 4011.90948272 3.10243043139
1576 1575 4017.06242897 3.26437353255 4014.79805544 3.26437353255
1577 1576 4020.11326226 3.42086661167 4017.69239565 3.42086661167
1578 1577 4023.16441281 3.57114662255 4020.59326619 3.57114662255
1579 1578 4026.21588041 3.71446031828 4023.5014201 3.71446031828
1580 1579 4029.26766488 3.85006791524 4026.41759696 3.85006791524
1581 1580 4032.31976599 3.97724672965 4029.34251926 3.97724672965
1582 1581 4035.37218357 4.09529476884 4032.2768888 4.09529476884
1583 1582 4038.4249174 4.20353425922 4035.22138314 4.20353425922
1584 1583 4041.47796728 4.30131509371 4038.17665219 4.30131509371
1585 1584 4044.53133302 4.38801818111 4041.14331484 4.38801818111
1586 1585 4047.58501442 4.46305868062 4044.12195574 4.46305868062
1587 1586 4050.63901127 4.52588910531 4047.11312217 4.52588910531
1588 1587 4053.69332339 4.5760022786 4050.11732111 4.5760022786
1589 1588 4056.74795056 4.61293412866 4053.13501643 4.61293412866
1590 1589 4059.80289259 4.63626630637 4056.16662629 4.63626630637
1591 1590 4062.85814929 4.64562861324 4059.21252068 4.64562861324
1592 1591 4065.91372045 4.64070122653 4062.27301923 4.64070122653
1593 1592 4068.96960589 4.62121670975 4065.34838918 4.62121670975
1594 1593 4072.02580539 4.58696179781 4068.43884359 4.58696179781
1595 1594 4075.08231876 4.53777894707 4071.54453981 4.53777894707
1596 1595 4078.13914581 4.47356764149 4074.66557817 4.47356764149
1597 1596 4081.19628634 4.39428544762 4077.80200089 4.39428544762
1598 1597 4084.25374016 4.29994881184 4080.95379134 4.29994881184
1599 1598 4087.31150706 4.190633595 4084.12087346 4.190633595
1600 1599 4090.36958685 4.06647534035 4087.30311151 4.06647534035
1601 1600 4093.42797933 3.92766927239 4090.50031006 3.92766927239
1602 1601 4096.48668432 3.77447002519 4093.7122143 3.77447002519
1603 1602 4099.54570161 3.60719110023 4096.93851051 3.60719110023
1604 1603 4102.60503102 3.42620405493 4100.17882696 3.42620405493
1605 1604 4105.66467233 3.23193742467 4103.43273491 3.23193742467
1606 1605 4108.72462537 3.02487538181 4106.69974999 3.02487538181
1607 1606 4111.78488993 2.8055561372 4109.9793338 2.8055561372
1608 1607 4114.84546583 2.57457009019 4113.27089574 2.57457009019
1609 1608 4117.90635287 2.33255773496 4116.57379513 2.33255773496
1610 1609 4120.96755085 2.08020733181 4119.88734351 2.08020733181
1611 1610 4124.02905958 1.81825235334 4123.21080723 1.81825235334
1612 1611 4127.09087887 1.54746871642 4126.54341015 1.54746871642
1613 1612 4130.15300853 1.26867181215 4129.88433672 1.26867181215
1614 1613 4133.21544836 0.982713346624 4133.23273501 0.982713346624
1615 1614 4136.27819817 0.690478006583 4136.58772017 0.690478006583
1616 1615 4139.34125778 0.392879964717 4139.94837781 0.392879964717
1617 1616 4142.40462698 0.0908592401534 4143.31376774 0.0908592401534
1618 1617 4145.46830558 -0.214622069503 4146.68292765 0.214622069503
1619 1618 4148.5322934 -0.522583667664 4150.05487707 0.522583667664
1620 1619 4151.59659025 -0.832031032287 4153.42862128 0.832031032287
1621 1620 4154.66119592 -1.14195946547 4156.80315539 1.14195946547
1622 1621 4157.72611024 -1.45135820075 4160.17746844 1.45135820075
1623 1622 4160.79133301 -1.75921454945 4163.55054756 1.75921454945
1624 1623 4163.85686404 -2.06451806721 4166.92138211 2.06451806721
1625 1624 4166.92270314 -2.36626472168 4170.28896787 2.36626472168
1626 1625 4169.98885013 -2.66346104246 4173.65231117 2.66346104246
1627 1626 4173.05530481 -2.95512823415 4177.01043304 2.95512823415
1628 1627 4176.12206699 -3.24030623394 4180.36237322 3.24030623394
1629 1628 4179.18913648 -3.51805769495 4183.70719418 3.51805769495
1630 1629 4182.2565131 -3.78747187726 4187.04398498 3.78747187726
1631 1630 4185.32419666 -4.04766842877 4190.37186509 4.04766842877
1632 1631 4188.39218696 -4.2978010386 4193.689988 4.2978010386
1633 1632 4191.46048383 -4.53706094621 4196.99754477 4.53706094621
1634 1633 4194.52908706 -4.76468029043 4200.29376735 4.76468029043
1635 1634 4197.59799649 -4.97993528287 4203.57793177 4.97993528287
1636 1635 4200.66721191 -5.18214919137 4206.8493611 5.18214919137
1637 1636 4203.73673314 -5.37069511982 4210.10742826 5.37069511982
1638 1637 4206.80655999 -5.54499857181 4213.35155856 5.54499857181
1639 1638 4209.87669228 -5.70453978636 4216.58123207 5.70453978636
1640 1639 4212.94712982 -5.84885583533 4219.79598566 5.84885583533
1641 1640 4216.01787243 -5.97754247289 4222.9954149 5.97754247289
1642 1641 4219.08891991 -6.09025572897 4226.17917564 6.09025572897
1643 1642 4222.16027209 -6.1867132395 4229.34698533 6.1867132395
1644 1643 4225.23192877 -6.26669530766 4232.49862408 6.26669530766
1645 1644 4228.30388977 -6.33004569157 4235.63393546 6.33004569157
1646 1645 4231.37615491 -6.37667211512 4238.75282703 6.37667211512
1647 1646 4234.448724 -6.40654650003 4241.8552705 6.40654650003
1648 1647 4237.52159686 -6.41970491831 4244.94130178 6.41970491831
1649 1648 4240.5947733 -6.41624726605 4248.01102057 6.41624726605
1650 1649 4243.66825314 -6.39633666009 4251.0645898 6.39633666009
1651 1650 4246.74203619 -6.36019856126 4254.10223475 6.36019856126
1652 1651 4249.81612227 -6.30811962827 4257.1242419 6.30811962827
1653 1652 4252.8905112 -6.24044630844 4260.13095751 6.24044630844
1654 1653 4255.9652028 -6.15758317194 4263.12278597 6.15758317194
1655 1654 4259.04019687 -6.05999099797 4266.10018787 6.05999099797
1656 1655 4262.11549324 -5.94818462207 4269.06367786 5.94818462207
1657 1656 4265.19109173 -5.82273055518 4272.01382228 5.82273055518
1658 1657 4268.26699214 -5.68424438578 4274.95123653 5.68424438578
1659 1658 4271.34319431 -5.53338797773 4277.87658229 5.53338797773
1660 1659 4274.41969805 -5.37086647723 4280.79056452 5.37086647723
1661 1660 4277.49650317 -5.19742514318 4283.69392831 5.19742514318
1662 1661 4280.5736095 -5.01384601605 4286.58745551 5.01384601605
1663 1662 4283.65101685 -4.82094444112 4289.47196129 4.82094444112
1664 1663 4286.72872504 -4.61956546251 4292.3482905 4.61956546251
1665 1664 4289.80673389 -4.41058010511 4295.217314 4.41058010511
1666 1665 4292.88504323 -4.19488156185 4298.07992479 4.19488156185
1667 1666 4295.96365287 -3.97338130432 4300.93703417 3.97338130432
1668 1667 4299.04256262 -3.74700513488 4303.78956776 3.74700513488
1669 1668 4302.12177232 -3.5166891988 4306.63846152 3.5166891988
1670 1669 4305.20128177 -3.28337597491 4309.48465775 3.28337597491
1671 1670 4308.28109081 -3.04801026354 4312.32910107 3.04801026354
1672 1671 4311.36119925 -2.81153519007 4315.17273444 2.81153519007
1673 1672 4314.44160691 -2.57488824285 4318.01649515 2.57488824285
1674 1673 4317.52231361 -2.33899736339 4320.86131097 2.33899736339
1675 1674 4320.60331918 -2.1047771069 4323.70809628 2.1047771069
1676 1675 4323.68462343 -1.87312489064 4326.55774832 1.87312489064
1677 1676 4326.76622619 -1.64491734701 4329.41114354 1.64491734701
1678 1677 4329.84812728 -1.42100679789 4332.26913408 1.42100679789
1679 1678 4332.93032652 -1.20221786598 4335.13254439 1.20221786598
1680 1679 4336.01282373 -0.989344238229 4338.00216797 0.989344238229
1681 1680 4339.09561875 -0.783145595621 4340.87876434 0.783145595621
1682 1681 4342.17871138 -0.584344722743 4343.7630561 0.584344722743
1683 1682 4345.26210145 -0.393624809603 4346.65572626 0.393624809603
1684 1683 4348.34578879 -0.21162695724 4349.55741574 0.21162695724
1685 1684 4351.42977321 -0.038947897584 4352.46872111 0.038947897584
1686 1685 4354.51405455 0.123862063032 4355.39019249 0.123862063032
1687 1686 4357.59863262 0.276300868446 4358.32233175 0.276300868446
1688 1687 4360.68350726 0.417916298221 4361.26559096 0.417916298221
1689 1688 4363.76867827 0.548307308267 4364.22037097 0.548307308267
1690 1689 4366.8541455 0.667125121849 4367.18702038 0.667125121849
1691 1690 4369.93990876 0.77407406752 4370.16583469 0.77407406752
1692 1691 4373.02596788 0.868912161792 4373.15705572 0.868912161792
1693 1692 4376.11232268 0.951451435599 4376.16087124 0.951451435599
1694 1693 4379.19897299 1.02155800487 4379.17741498 1.02155800487
1695 1694 4382.28591863 1.07915188682 4382.20676674 1.07915188682
1696 1695 4385.37315943 1.12420656469 4385.24895287 1.12420656469
1697 1696 4388.46069522 1.15674830511 4388.30394692 1.15674830511
1698 1697 4391.54852582 1.17685523319 4391.37167059 1.17685523319
1699 1698 4394.63665105 1.18465617186 4394.45199488 1.18465617186
1700 1699 4397.72507076 1.18032925291 4397.5447415 1.18032925291
1701 1700 4400.81378475 1.16410030848 4400.64968444 1.16410030848
1702 1701 4403.90279285 1.13624105256 4403.7665518 1.13624105256
1703 1702 4406.99209491 1.09706706325 4406.89502785 1.09706706325
1704 1703 4410.08169073 1.04693557742 4410.03475516 1.04693557742
1705 1704 4413.17158016 0.986243110219 4413.18533705 0.986243110219
1706 1705 4416.26176301 0.915422912687 4416.3463401 0.915422912687
1707 1706 4419.35223912 0.834942281651 4419.51729684 0.834942281651
1708 1707 4422.44300831 0.745299736488 4422.69770857 0.745299736488
1709 1708 4425.53407041 0.64702207812 4425.88704833 0.64702207812
1710 1709 4428.62542525 0.540661346046 4429.08476391 0.540661346046
1711 1710 4431.71707266 0.426791689657 4432.29028097 0.426791689657
1712 1711 4434.80901247 0.306006170424 4435.5030063 0.306006170424
1713 1712 4437.90124451 0.178913511834 4438.722331 0.178913511834
1714 1713 4440.9937686 0.0461348140831 4441.94763379 0.0461348140831
1715 1714 4444.08658458 -0.0916997493219 4445.17828433 0.0916997493219
1716 1715 4447.17969227 -0.233954235949 4448.4136465 0.233954235949
1717 1716 4450.27309151 -0.379990222756 4451.65308173 0.379990222756
1718 1717 4453.36678212 -0.529170061478 4454.89595218 0.529170061478
1719 1718 4456.46076394 -0.680860084452 4458.14162402 0.680860084452
1720 1719 4459.55503679 -0.83443374463 4461.38947054 0.83443374463
1721 1720 4462.64960051 -0.989274673902 4464.63887519 0.989274673902
1722 1721 4465.74445493 -1.1447796444 4467.88923458 1.1447796444
1723 1722 4468.83959988 -1.30036141801 4471.1399613 1.30036141801
1724 1723 4471.93503519 -1.45545146991 4474.39048666 1.45545146991
1725 1724 4475.03076069 -1.60950257291 4477.64026326 1.60950257291
1726 1725 4478.12677621 -1.76199122972 4480.88876744 1.76199122972
1727 1726 4481.22308159 -1.91241994168 4484.13550153 1.91241994168
1728 1727 4484.31967665 -2.0603193029 4487.37999595 2.0603193029
1729 1728 4487.41656124 -2.20524991001 4490.62181115 2.20524991001
1730 1729 4490.51373517 -2.34680407868 4493.86053925 2.34680407868
1731 1730 4493.61119829 -2.48460735905 4497.09580565 2.48460735905
1732 1731 4496.70895043 -2.61831984336 4500.32727027 2.61831984336
1733 1732 4499.80699142 -2.74763726021 4503.55462868 2.74763726021
1734 1733 4502.90532109 -2.872291851 4506.77761294 2.872291851
1735 1734 4506.00393928 -2.99205302526 4509.9959923 2.99205302526
1736 1735 4509.10284582 -3.10672779281 4513.20957361 3.10672779281
1737 1736 4512.20204054 -3.21616097184 4516.41820151 3.21616097184
1738 1737 4515.30152328 -3.3202351732 4519.62175846 3.3202351732
1739 1738 4518.40129388 -3.41887056249 4522.82016444 3.41887056249
1740 1739 4521.50135216 -3.51202440246 4526.01337656 3.51202440246
1741 1740 4524.60169796 -3.59969037974 4529.20138834 3.59969037974
1742 1741 4527.70233112 -3.68189772073 4532.38422884 3.68189772073
1743 1742 4530.80325147 -3.7587101029 4535.56196158 3.7587101029
1744 1743 4533.90445885 -3.83022436856 4538.73468322 3.83022436856
1745 1744 4537.00595309 -3.89656904936 4541.90252214 3.89656904936
1746 1745 4540.10773403 -3.95790271079 4545.06563674 3.95790271079
1747 1746 4543.2098015 -4.01441212676 4548.22421362 4.01441212676
1748 1747 4546.31215533 -4.06631029543 4551.37846563 4.06631029543
1749 1748 4549.41479538 -4.1138343081 4554.52862969 4.1138343081
1750 1749 4552.51772146 -4.15724308378 4557.67496455 4.15724308378
1751 1750 4555.62093342 -4.19681498304 4560.81774841 4.19681498304
1752 1751 4558.7244311 -4.23284531482 4563.95727642 4.23284531482
1753 1752 4561.82821433 -4.26564375102 4567.09385808 4.26564375102
1754 1753 4564.93228294 -4.29553166378 4570.22781461 4.29553166378
1755 1754 4568.03663678 -4.32283940096 4573.35947618 4.32283940096
1756 1755 4571.14127569 -4.3479035155 4576.4891792 4.3479035155
1757 1756 4574.24619949 -4.37106396481 4579.61726346 4.37106396481
1758 1757 4577.35140803 -4.39266129612 4582.74406933 4.39266129612
1759 1758 4580.45690115 -4.41303383431 4585.86993499 4.41303383431
1760 1759 4583.56267868 -4.43251488814 4588.99519357 4.43251488814
1761 1760 4586.66874047 -4.45142999117 4592.12017046 4.45142999117
1762 1761 4589.77508634 -4.47009419327 4595.24518054 4.47009419327
1763 1762 4592.88171615 -4.48880941826 4598.37052557 4.48880941826
1764 1763 4595.98862972 -4.50786190314 4601.49649162 4.50786190314
1765 1764 4599.0958269 -4.52751973362 4604.62334664 4.52751973362
1766 1765 4602.20330753 -4.54803049042 4607.75133802 4.54803049042
1767 1766 4605.31107144 -4.56961902002 4610.88069046 4.56961902002
1768 1767 4608.41911848 -4.59248534308 4614.01160382 4.59248534308
1769 1768 4611.52744849 -4.61680271273 4617.1442512 4.61680271273
1770 1769 4614.6360613 -4.6427158345 4620.27877713 4.6427158345
1771 1770 4617.74495675 -4.67033925848 4623.41529601 4.67033925848
1772 1771 4620.85413469 -4.69975595361 4626.55389065 4.69975595361
1773 1772 4623.96359496 -4.73101607288 4629.69461104 4.73101607288
1774 1773 4627.0733374 -4.76413591732 4632.83747331 4.76413591732
1775 1774 4630.18336184 -4.79909710552 4635.98245895 4.79909710552
1776 1775 4633.29366813 -4.83584595444 4639.12951409 4.83584595444
1777 1776 4636.40425611 -4.87429307594 4642.27854919 4.87429307594
1778 1777 4639.51512563 -4.91431319254 4645.42943882 4.91431319254
1779 1778 4642.62627651 -4.95574517469 4648.58202169 4.95574517469
1780 1779 4645.73770862 -4.99839230047 4651.73610092 4.99839230047
1781 1780 4648.84942177 -5.04202273768 4654.89144451 5.04202273768
1782 1781 4651.96141583 -5.08637024698 4658.04778608 5.08637024698
1783 1782 4655.07369063 -5.13113510365 4661.20482573 5.13113510365
1784 1783 4658.18624601 -5.17598523401 4664.36223125 5.17598523401
1785 1784 4661.29908182 -5.22055756207 4667.51963938 5.22055756207
1786 1785 4664.4121979 -5.26445955999 4670.67665746 5.26445955999
1787 1786 4667.52559409 -5.3072709956 4673.83286508 5.3072709956
1788 1787 4670.63927023 -5.34854586859 4676.9878161 5.34854586859
1789 1788 4673.75322617 -5.38781452626 4680.1410407 5.38781452626
1790 1789 4676.86746176 -5.42458594863 4683.29204771 5.42458594863
1791 1790 4679.98197683 -5.45835019175 4686.44032702 5.45835019175
1792 1791 4683.09677123 -5.48858097723 4689.58535221 5.48858097723
1793 1792 4686.2118448 -5.51473841509 4692.72658322 5.51473841509
1794 1793 4689.3271974 -5.53627184636 4695.86346924 5.53627184636
1795 1794 4692.44282885 -5.5526227912 4698.99545164 5.5526227912
1796 1795 4695.55873901 -5.56322798753 4702.121967 5.56322798753
1797 1796 4698.67492772 -5.56752250468 4705.24245023 5.56752250468
1798 1797 4701.79139483 -5.56494291634 4708.35633775 5.56494291634
1799 1798 4704.90814018 -5.55493051622 4711.4630707 5.55493051622
1800 1799 4708.02516362 -5.53693456002 4714.56209818 5.53693456002
1801 1800 4711.14246499 -5.51041551679 4717.65288051 5.51041551679
1802 1801 4714.26004414 -5.47484831265 4720.73489245 5.47484831265
1803 1802 4717.37790091 -5.42972554999 4723.80762646 5.42972554999
1804 1803 4720.49603515 -5.37456068501 4726.87059583 5.37456068501
1805 1804 4723.6144467 -5.30889114688 4729.92333785 5.30889114688
1806 1805 4726.73313542 -5.23228138183 4732.9654168 5.23228138183
1807 1806 4729.85210115 -5.14432580568 4735.99642695 5.14432580568
1808 1807 4732.97134373 -5.04465164917 4739.01599538 5.04465164917
1809 1808 4736.09086301 -4.93292168024 4742.02378469 4.93292168024
1810 1809 4739.21065884 -4.80883678849 4745.01949563 4.80883678849
1811 1810 4742.33073107 -4.67213841743 4748.00286949 4.67213841743
1812 1811 4745.45107954 -4.52261083095 4750.97369037 4.52261083095
1813 1812 4748.5717041 -4.36008320094 4753.9317873 4.36008320094
1814 1813 4751.6926046 -4.18443150426 4756.8770361 4.18443150426
1815 1814 4754.81378089 -3.99558021774 4759.8093611 3.99558021774
1816 1815 4757.9352328 -3.79350380101 4762.72873661 3.79350380101
1817 1816 4761.05696021 -3.57822795822 4765.63518816 3.57822795822
1818 1817 4764.17896294 -3.34983067012 4768.52879361 3.34983067012
1819 1818 4767.30124085 -3.10844298991 4771.40968384 3.10844298991
1820 1819 4770.42379378 -2.85424959666 4774.27804338 2.85424959666
1821 1820 4773.5466216 -2.58748910178 4777.1341107 2.58748910178
1822 1821 4776.66972414 -2.308454105 4779.97817824 2.308454105
1823 1822 4779.79310125 -2.01749099755 4782.81059225 2.01749099755
1824 1823 4782.91675279 -1.71499951155 4785.6317523 1.71499951155
1825 1824 4786.0406786 -1.40143201579 4788.44211062 1.40143201579
1826 1825 4789.16487853 -1.07729255944 4791.24217109 1.07729255944
1827 1826 4792.28935244 -0.743135666253 4794.03248811 0.743135666253
1828 1827 4795.41410017 -0.399564883386 4796.81366505 0.399564883386
1829 1828 4798.53912157 -0.047231089892 4799.58635266 0.047231089892
1830 1829 4801.66441649 0.313169428709 4802.35124706 0.313169428709
1831 1830 4804.78998479 0.680897132232 4805.10908766 0.680897132232
1832 1831 4807.91582631 1.05517159533 4807.86065472 1.05517159533
1833 1832 4811.04194091 1.43517408493 4810.60676682 1.43517408493
1834 1833 4814.16832843 1.8200503347 4813.3482781 1.8200503347
1835 1834 4817.29498873 2.2089135049 4816.08607523 2.2089135049
1836 1835 4820.42192166 2.6008473145 4818.82107434 2.6008473145
1837 1836 4823.54912707 2.99490933236 4821.55421773 2.99490933236
1838 1837 4826.6766048 3.39013441245 4824.28647039 3.39013441245
1839 1838 4829.80435472 3.78553825839 4827.01881647 3.78553825839
1840 1839 4832.93237668 4.18012110095 4829.75225558 4.18012110095
1841 1840 4836.06067052 4.5728714723 4832.48779905 4.5728714723
1842 1841 4839.1892361 4.96277005974 4835.22646604 4.96277005974
1843 1842 4842.31807328 5.34879362158 4837.96927966 5.34879362158
1844 1843 4845.4471819 5.72991894718 4840.71726295 5.72991894718
1845 1844 4848.57656181 6.10512684314 4843.47143497 6.10512684314
1846 1845 4851.70621287 6.47340612729 4846.23280675 6.47340612729
1847 1846 4854.83613494 6.83375761202 4849.00237733 6.83375761202
1848 1847 4857.96632786 7.18519805868 4851.7811298 7.18519805868
1849 1848 4861.09679149 7.52676408461 4854.57002741 7.52676408461
1850 1849 4864.22752569 7.85751600466 4857.37000968 7.85751600466
1851 1850 4867.3585303 8.17654158944 4860.18198871 8.17654158944
1852 1851 4870.48980518 8.48295972257 4863.00684546 8.48295972257
1853 1852 4873.62135019 8.77592393999 4865.84542625 8.77592393999
1854 1853 4876.75316517 9.05462583473 4868.69853934 9.05462583473
1855 1854 4879.88524999 9.31829831101 4871.56695168 9.31829831101
1856 1855 4883.01760449 9.56621867262 4874.45138582 9.56621867262
1857 1856 4886.15022854 9.79771153082 4877.35251701 9.79771153082
1858 1857 4889.28312198 10.0121515181 4880.27097046 10.0121515181
1859 1858 4892.41628467 10.2089657951 4883.20731888 10.2089657951
1860 1859 4895.54971647 10.3876363387 4886.16208013 10.3876363387
1861 1860 4898.68341723 10.5477020002 4889.13571523 10.5477020002
1862 1861 4901.81738681 10.6887603245 4892.12862649 10.6887603245
1863 1862 4904.95162507 10.810469121 4895.14115594 10.810469121
1864 1863 4908.08613185 10.9125477783 4898.17358407 10.9125477783
1865 1864 4911.22090701 10.9947783184 4901.22612869 10.9947783184
1866 1865 4914.35595042 11.0570061823 4904.29894423 11.0570061823
1867 1866 4917.49126192 11.0991407459 4907.39212117 11.0991407459
1868 1867 4920.62684137 11.1211555622 4910.50568581 11.1211555622
1869 1868 4923.76268863 11.1230883289 4913.63960031 11.1230883289
1870 1869 4926.89880356 11.1050405815 4916.79376298 11.1050405815
1871 1870 4930.03518602 11.0671771133 4919.9680089 11.0671771133
1872 1871 4933.17183585 11.0097251249 4923.16211072 11.0097251249
1873 1872 4936.30875292 10.9329731065 4926.37577981 10.9329731065
1874 1873 4939.44593708 10.8372694596 4929.60866762 10.8372694596
1875 1874 4942.5833882 10.7230208632 4932.86036733 10.7230208632
1876 1875 4945.72110612 10.5906903925 4936.13041573 10.5906903925
1877 1876 4948.85909071 10.440795399 4939.41829531 10.440795399
1878 1877 4951.99734182 10.2739051623 4942.72343666 10.2739051623
1879 1878 4955.13585932 10.0906383236 4946.045221 10.0906383236
1880 1879 4958.27464306 9.89166011386 4949.38298294 9.89166011386
1881 1880 4961.41369289 9.67767938921 4952.7360135 9.67767938921
1882 1881 4964.55300869 9.44944548759 4956.1035632 9.44944548759
1883 1882 4967.6925903 9.20774492129 4959.48484538 9.20774492129
1884 1883 4970.83243758 8.95339792099 4962.87903966 8.95339792099
1885 1884 4973.9725504 8.68725484752 4966.28529555 8.68725484752
1886 1885 4977.11292861 8.41019248805 4969.70273613 8.41019248805
1887 1886 4980.25357208 8.12311025416 4973.13046182 8.12311025416
1888 1887 4983.39448065 7.8269262996 4976.56755435 7.8269262996
1889 1888 4986.5356542 7.52257357581 4980.01308062 7.52257357581
1890 1889 4989.67709257 7.21099584373 4983.46609673 7.21099584373
1891 1890 4992.81879564 6.89314366052 4986.92565198 6.89314366052
1892 1891 4995.96076326 6.56997035987 4990.3907929 6.56997035987
1893 1892 4999.10299528 6.24242804469 4993.86056724 6.24242804469
1894 1893 5002.24549158 5.91146361073 4997.33402797 5.91146361073
1895 1894 5005.38825201 5.57801481969 5000.81023719 5.57801481969
1896 1895 5008.53127643 5.24300644005 5004.28826999 5.24300644005
1897 1896 5011.6745647 4.90734647328 5007.76721823 4.90734647328
1898 1897 5014.81811669 4.5719224831 5011.24619421 4.5719224831
1899 1898 5017.96193225 4.23759804445 5014.7243342 4.23759804445
1900 1899 5021.10601124 3.9052093286 5018.20080191 3.9052093286
1901 1900 5024.25035353 3.57556183997 5021.67479169 3.57556183997
1902 1901 5027.39495898 3.2494273194 5025.14553166 3.2494273194
1903 1902 5030.53982745 2.92754082802 5028.61228662 2.92754082802
1904 1903 5033.6849588 2.61059802478 5032.07436078 2.61059802478
1905 1904 5036.8303529 2.29925264975 5035.53110025 2.29925264975
1906 1905 5039.97600959 1.99411422436 5038.98189537 1.99411422436
1907 1906 5043.12192876 1.69574597868 5042.42618278 1.69574597868
1908 1907 5046.26811025 1.40466301467 5045.86344724 1.40466301467
1909 1908 5049.41455394 1.12133071306 5049.29322323 1.12133071306
1910 1909 5052.56125968 0.84616339071 5052.71509629 0.84616339071
1911 1910 5055.70822734 0.579523213544 5056.12870413 0.579523213544
1912 1911 5058.85545678 0.32171936933 5059.53373741 0.32171936933
1913 1912 5062.00294786 0.0730075030858 5062.92994036 0.0730075030858
1914 1913 5065.15070045 -0.166410583327 5066.31711103 0.166410583327
1915 1914 5068.2987144 -0.396386967158 5069.69510137 0.396386967158
1916 1915 5071.44698959 -0.616827377278 5073.06381697 0.616827377278
1917 1916 5074.59552588 -0.82769070557 5076.42321659 0.82769070557
1918 1917 5077.74432313 -1.02898826075 5079.77331139 1.02898826075
1919 1918 5080.8933812 -1.22078276947 5083.11416397 1.22078276947
1920 1919 5084.04269996 -1.40318713065 5086.44588709 1.40318713065
1921 1920 5087.19227927 -1.57636293046 5089.7686422 1.57636293046
1922 1921 5090.342119 -1.74051872612 5093.08263773 1.74051872612
1923 1922 5093.49221901 -1.89590810815 5096.38812712 1.89590810815
1924 1923 5096.64257917 -2.04282755161 5099.68540672 2.04282755161
1925 1924 5099.79319933 -2.18161406789 5102.9748134 2.18161406789
1926 1925 5102.94407937 -2.31264266953 5106.25672204 2.31264266953
1927 1926 5106.09521916 -2.43632366157 5109.53154282 2.43632366157
1928 1927 5109.24661854 -2.55309977351 5112.79971832 2.55309977351
1929 1928 5112.3982774 -2.66344314702 5116.06172055 2.66344314702
1930 1929 5115.55019559 -2.76785219492 5119.31804779 2.76785219492
1931 1930 5118.70237299 -2.86684834771 5122.56922134 2.86684834771
1932 1931 5121.85480945 -2.96097270443 5125.81578216 2.96097270443
1933 1932 5125.00750485 -3.05078260499 5129.05828745 3.05078260499
1934 1933 5128.16045904 -3.1368481415 5132.29730718 3.1368481415
1935 1934 5131.3136719 -3.2197486264 5135.53342053 3.2197486264
1936 1935 5134.46714329 -3.30006903537 5138.76721233 3.30006903537
1937 1936 5137.62087308 -3.37839644291 5141.99926953 3.37839644291
1938 1937 5140.77486114 -3.45531646886 5145.23017761 3.45531646886
1939 1938 5143.92910732 -3.53140975344 5148.46051708 3.53140975344
1940 1939 5147.08361151 -3.6072484789 5151.69085999 3.6072484789
1941 1940 5150.23837356 -3.6833929549 5154.92176651 3.6833929549
1942 1941 5153.39339334 -3.760388285 5158.15378162 3.760388285
1943 1942 5156.54867071 -3.83876113065 5161.38743185 3.83876113065
1944 1943 5159.70420556 -3.91901658897 5164.62322215 3.91901658897
1945 1944 5162.85999774 -4.0016351997 5167.86163294 4.0016351997
1946 1945 5166.01604712 -4.08707009633 5171.10311722 4.08707009633
1947 1946 5169.17235357 -4.17574431514 5174.34809789 4.17574431514
1948 1947 5172.32891696 -4.2680482758 5177.59696524 4.2680482758
1949 1948 5175.48573716 -4.36433744549 5180.8500746 4.36433744549
1950 1949 5178.64281402 -4.46493019822 5184.10774422 4.46493019822
1951 1950 5181.80014743 -4.57010587959 5187.37025331 4.57010587959
1952 1951 5184.95773725 -4.68010308636 5190.63784034 4.68010308636
1953 1952 5188.11558335 -4.79511816908 5193.91070152 4.79511816908
1954 1953 5191.27368559 -4.91530396485 5197.18898956 4.91530396485
1955 1954 5194.43204386 -5.04076876614 5200.47281262 5.04076876614
1956 1955 5197.590658 -5.17157553041 5203.76223353 5.17157553041
1957 1956 5200.74952791 -5.30774133395 5207.05726924 5.30774133395
1958 1957 5203.90865343 -5.44923707231 5210.3578905 5.44923707231
1959 1958 5207.06803445 -5.5959874082 5213.66402186 5.5959874082
1960 1959 5210.22767083 -5.74787096676 5216.9755418 5.74787096676
1961 1960 5213.38756244 -5.90472077656 5220.29228322 5.90472077656
1962 1961 5216.54770916 -6.06632495374 5223.61403411 6.06632495374
1963 1962 5219.70811085 -6.23242762519 5226.94053847 6.23242762519
1964 1963 5222.86876738 -6.4027300858 5230.27149746 6.4027300858
1965 1964 5226.02967862 -6.57689218332 5233.6065708 6.57689218332
1966 1965 5229.19084444 -6.75453392332 5236.94537837 6.75453392332
1967 1966 5232.35226472 -6.93523728591 5240.28750201 6.93523728591
1968 1967 5235.51393932 -7.11854824434 5243.63248756 7.11854824434
1969 1968 5238.67586811 -7.30397897504 5246.97984709 7.30397897504
1970 1969 5241.83805097 -7.49101024735 5250.32906122 7.49101024735
1971 1970 5245.00048777 -7.67909398072 5253.67958175 7.67909398072
1972 1971 5248.16317837 -7.86765595576 5257.03083433 7.86765595576
1973 1972 5251.32612265 -8.05609866543 5260.38222132 8.05609866543
1974 1973 5254.48932049 -8.24380429125 5263.73312478 8.24380429125
1975 1974 5257.65277174 -8.43013778961 5267.08290953 8.43013778961
1976 1975 5260.81647628 -8.61445007181 5270.43092635 8.61445007181
1977 1976 5263.98043399 -8.79608126195 5273.77651525 8.79608126195
1978 1977 5267.14464474 -8.9743640156 5277.11900875 8.9743640156
1979 1978 5270.30910839 -9.14862688241 5280.45773527 9.14862688241
1980 1979 5273.47382483 -9.31819769551 5283.79202252 9.31819769551
1981 1980 5276.63879392 -9.48240697024 5287.12120089 9.48240697024
1982 1981 5279.80401553 -9.640591295 5290.44460682 9.640591295
1983 1982 5282.96948954 -9.79209669687 5293.76158624 9.79209669687
1984 1983 5286.13521582 -9.936281965 5297.07149779 9.936281965
1985 1984 5289.30119424 -10.0725219146 5300.37371616 10.0725219146
1986 1985 5292.46742469 -10.2002105755 5303.66763526 10.2002105755
1987 1986 5295.63390702 -10.3187642882 5306.9526713 10.3187642882
1988 1987 5298.80064111 -10.4276246932 5310.2282658 10.4276246932
1989 1988 5301.96762684 -10.5262615965 5313.49388843 10.5262615965
1990 1989 5305.13486407 -10.6141756989 5316.74903977 10.6141756989
1991 1990 5308.30235269 -10.6909011738 5319.99325387 10.6909011738
1992 1991 5311.47009257 -10.7560080814 5323.22610065 10.7560080814
1993 1992 5314.63808357 -10.8091046064 5326.44718818 10.8091046064
1994 1993 5317.80632558 -10.8498391089 5329.65616469 10.8498391089
1995 1994 5320.97481847 -10.8779019776 5332.85272045 10.8779019776
1996 1995 5324.14356211 -10.8930272758 5336.03658939 10.8930272758
1997 1996 5327.31255638 -10.8949941736 5339.20755055 10.8949941736
1998 1997 5330.48180115 -10.8836281564 5342.3654293 10.8836281564
1999 1998 5333.65129629 -10.8588020067 5345.5100983 10.8588020067
2000 1999 5336.82104168 -10.8204365528 5348.64147824 10.8204365528
2001 2000 5339.9910372 -10.7685011806 5351.75953838 10.7685011806

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())