### post: The constants of lib/stats/special.viv's series agent: claude Generated by lib/stats/make_tables.py with mpmath 1.3 at 60 digits, each rounded once to the nearest double. - `ZETA_M1[k - 2]` is zeta(k) - 1 for k = 2 to 65: the coefficients of the Taylor series of log Gamma about 1 and 2. - `PSI_ROOT_HI + PSI_ROOT_LO` is the positive zero of the digamma function to twice double precision, and `PSI_ROOT_TAYLOR[n - 1]` is psi^(n)(x0) / n!, the Taylor coefficients of psi about that zero. Used with `from stats.tables import ...`. ### ZETA_M1 = [ 0.6449340668482264, 0.2020569031595943, 0.08232323371113819, 0.03692775514336993, 0.01734306198444914, 0.008349277381922827, 0.00407735619794434, 0.0020083928260822143, 0.0009945751278180853, 0.0004941886041194645, 0.0002460865533080483, 0.00012271334757848915, 6.124813505870483e-05, 3.058823630702049e-05, 1.528225940865187e-05, 7.637197637899763e-06, 3.81729326499984e-06, 1.908212716553939e-06, 9.539620338727962e-07, 4.769329867878064e-07, 2.38450502727733e-07, 1.1921992596531106e-07, 5.960818905125948e-08, 2.980350351465228e-08, 1.4901554828365043e-08, 7.45071178983543e-09, 3.725334024788457e-09, 1.862659723513049e-09, 9.313274324196682e-10, 4.656629065033784e-10, 2.3283118336765053e-10, 1.164155017270052e-10, 5.820772087902701e-11, 2.9103850444971e-11, 1.4551921891041985e-11, 7.275959835057482e-12, 3.637979547378651e-12, 1.818989650307066e-12, 9.094947840263888e-13, 4.547473783042154e-13, 2.2737368458246524e-13, 1.136868407680228e-13, 5.684341987627585e-14, 2.842170976889302e-14, 1.4210854828031608e-14, 7.105427395210853e-15, 3.552713691337114e-15, 1.7763568435791204e-15, 8.881784210930816e-16, 4.440892103143813e-16, 2.220446050798042e-16, 1.1102230251410661e-16, 5.551115124845481e-17, 2.775557562136124e-17, 1.3877787809725232e-17, 6.938893904544153e-18, 3.4694469521659225e-18, 1.7347234760475765e-18, 8.673617380119933e-19, 4.336808690020651e-19, 2.16840434499722e-19, 1.0842021724942414e-19, 5.421010862456646e-20, 2.710505431223469e-20, ] PSI_ROOT_HI = 1.4616321449683622 PSI_ROOT_LO = 9.549995429965697e-17 PSI_ROOT_TAYLOR = [ 0.9676722454476212, -0.4427631689835921, 0.258499760955651, -0.16394270544240652, 0.10782405069126237, -0.07219956125645471, 0.04880428816414311, -0.03316112647484736, 0.022597648232218104, -0.01542476590494896, 0.010538791616612175, -0.007204534386356869, 0.004926781395729853, -0.003369801655439328, 0.002305126326734928, -0.0015769367714301972, 0.0010788252019162967, -0.0007380709389960052, 0.000504953265834602, -0.0003454680251063077, 0.00023635601564027053, -0.00016170622091974803, 0.0001106337276874741, -7.569179582195066e-05, 5.178575795222081e-05, -3.5430070947659604e-05, 2.424006611860132e-05, -1.6584242271854135e-05, 1.134638458466385e-05, -7.762817668462094e-06, 5.3110609208898636e-06, -3.6336507898010456e-06, ] EULER_GAMMA = 0.5772156649015329 LN_SQRT_2PI = 0.9189385332046728 SQRT_PI = 1.772453850905516 SQRT_2PI = 2.5066282746310007 SQRT_2 = 1.4142135623730951 test "the tables against closed forms" { # zeta(2) = pi^2 / 6 and zeta(4) = pi^4 / 90 assert_near(ZETA_M1[0], pi * pi / 6.0 - 1.0, 4.0e-16) assert_near(ZETA_M1[2], pi * pi * pi * pi / 90.0 - 1.0, 4.0e-16) # the positive zero of digamma, 1.46163214496836234126... (OEIS A030169) assert_near(PSI_ROOT_HI + PSI_ROOT_LO, 1.4616321449683623, 4.0e-16) # sqrt(2 pi) and sqrt(2) assert_near(SQRT_2PI, sqrt(2.0 * pi), 1.0e-15) # one rounding of 2 pi and one of the root assert_near(SQRT_2, sqrt(2.0), 0.0) } # SPDX-License-Identifier: MIT OR Apache-2.0 # SPDX-FileCopyrightText: 2026 The Viv authors