== Part 1 (A.26: RQ-A U.2, RQ-B C19(d)) ==
PASS K=2: s(q_K) = ln(K/(K-1))/2
PASS K=2: tie g((K-1)s_K) = g(K s_K)
PASS K=2: (K-1)s_K < 1/2 < K s_K
PASS K=2: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=3: s(q_K) = ln(K/(K-1))/2
PASS K=3: tie g((K-1)s_K) = g(K s_K)
PASS K=3: (K-1)s_K < 1/2 < K s_K
PASS K=3: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=3: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=4: s(q_K) = ln(K/(K-1))/2
PASS K=4: tie g((K-1)s_K) = g(K s_K)
PASS K=4: (K-1)s_K < 1/2 < K s_K
PASS K=4: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=4: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=5: s(q_K) = ln(K/(K-1))/2
PASS K=5: tie g((K-1)s_K) = g(K s_K)
PASS K=5: (K-1)s_K < 1/2 < K s_K
PASS K=5: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=5: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=6: s(q_K) = ln(K/(K-1))/2
PASS K=6: tie g((K-1)s_K) = g(K s_K)
PASS K=6: (K-1)s_K < 1/2 < K s_K
PASS K=6: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=6: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=7: s(q_K) = ln(K/(K-1))/2
PASS K=7: tie g((K-1)s_K) = g(K s_K)
PASS K=7: (K-1)s_K < 1/2 < K s_K
PASS K=7: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=7: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=8: s(q_K) = ln(K/(K-1))/2
PASS K=8: tie g((K-1)s_K) = g(K s_K)
PASS K=8: (K-1)s_K < 1/2 < K s_K
PASS K=8: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=8: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=9: s(q_K) = ln(K/(K-1))/2
PASS K=9: tie g((K-1)s_K) = g(K s_K)
PASS K=9: (K-1)s_K < 1/2 < K s_K
PASS K=9: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=9: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=10: s(q_K) = ln(K/(K-1))/2
PASS K=10: tie g((K-1)s_K) = g(K s_K)
PASS K=10: (K-1)s_K < 1/2 < K s_K
PASS K=10: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=10: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=11: s(q_K) = ln(K/(K-1))/2
PASS K=11: tie g((K-1)s_K) = g(K s_K)
PASS K=11: (K-1)s_K < 1/2 < K s_K
PASS K=11: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=11: C(q_K) > C(q_(K-1)) (increasing in K)
PASS K=12: s(q_K) = ln(K/(K-1))/2
PASS K=12: tie g((K-1)s_K) = g(K s_K)
PASS K=12: (K-1)s_K < 1/2 < K s_K
PASS K=12: RQ-B form sqrt(2/e)/(1+E_(K-1)) = g((K-1)s_K)
PASS K=12: C(q_K) > C(q_(K-1)) (increasing in K)
  C(q_4) = 0.853343568496, eta_4 = 0.0044203165
PASS K=4: RQ-A C(q_K) = 0.853344 (6 decimals)
PASS K=4: RQ-A eta_K = 0.00442 (5 decimals)
PASS K=4: RQ-B C_K = 0.8533436 (7 decimals)
PASS K=4: RQ-B sqrt(2/e) - C_K = 0.0044203 (7 decimals)
  C(q_5) = 0.855100455471, eta_5 = 0.0026634295
PASS K=5: RQ-A C(q_K) = 0.855100 (6 decimals)
PASS K=5: RQ-A eta_K = 0.00266 (5 decimals)
PASS K=5: RQ-B C_K = 0.8551005 (7 decimals)
PASS K=5: RQ-B sqrt(2/e) - C_K = 0.0026634 (7 decimals)
  C(q_6) = 0.855984489174, eta_6 = 0.0017793958
PASS K=6: RQ-A C(q_K) = 0.855984 (6 decimals)
PASS K=6: RQ-A eta_K = 0.00178 (5 decimals)
PASS K=6: RQ-B C_K = 0.8559845 (7 decimals)
PASS K=6: RQ-B sqrt(2/e) - C_K = 0.0017794 (7 decimals)
  K=10: eta_K * 16 (K-1)^2 / sqrt(2/e) = 0.89871755
  K=100: eta_K * 16 (K-1)^2 / sqrt(2/e) = 0.98998715
  K=1000: eta_K * 16 (K-1)^2 / sqrt(2/e) = 0.99899987
  K=10000: eta_K * 16 (K-1)^2 / sqrt(2/e) = 0.99990000
PASS asymptotic eta_K ~ sqrt(2/e)/(16 K^2): ratio at K = 10^4 within 1e-3 of 1
PASS K=4: grid of 4000 points in (0, q_K]: min C(q) - C(q_K) >= -1e-60 (min 0e-75)
PASS K=5: grid of 4000 points in (0, q_K]: min C(q) - C(q_K) >= -1e-60 (min 0e-75)
PASS K=6: grid of 4000 points in (0, q_K]: min C(q) - C(q_K) >= -1e-60 (min 0e-75)
PASS RQ-B Rem. 4.5(2): [3 s_4, 4 s_4] = [0.4315, 0.5754] (4 decimals)
PASS RQ-B Rem. 4.5(2): a in [1.318, 1.523] (3 decimals)
  1/sqrt(4 s_4) = 1.3183436, 1/sqrt(3 s_4) = 1.5222920
== Part 2 (A.27: RQ-B C20) ==
  r_1 = 0.8198325579
PASS r_1 = 0.8198326 (7 decimals)
  gamma_4 = 0.8235571585
  gamma_5 = 0.8317944224
  gamma_6 = 0.8368419138
PASS gamma_4 = 0.8235571 as a lower bound (truncated; the value is 0.82355716)
FINDING (quoted value false as written) gamma_4 = 0.8235571 rounded to 7 decimals (expected to fail: the 7-decimal rounding is 0.8235572)
PASS gamma_5 = 0.83179, gamma_6 = 0.83684 (5 decimals)
PASS gamma_4 > r_1, margin 0.0037 (4 decimals)
  sqrt(1-q3) M(q3) = 0.80774786
PASS sqrt(1-q3) M(q3) = 0.8077 < r_1 (RQ-B remark: the argument fails at q3)
PASS q/s(q) decreasing on a grid of (0, 1/2)
== Part 3 (A.28: RQ-C C15(g)) ==
  A'(0.05) = 1.469758898
PASS A'(0.05) = 1.46976 (5 decimals)
  A'(q_6) = 1.514548376
PASS A'(q_6) = 1.51455 (5 decimals)
  A'(0.1) = 1.530853194
PASS A'(0.1) = 1.53085 (5 decimals)
  A'(q_5) = 1.538044392
PASS A'(q_5) = 1.53804 (5 decimals)
  A'(q_4) = 1.575992669
PASS A'(q_4) = 1.57599 (5 decimals)
PASS OR_4 atom at q_5: a = sqrt(2/(4 ln(5/4))) = 1.49690
PASS a(OR_4 at q_5) = 1/sqrt(4 s(q_5))
PASS A' increasing: s(1+q) > q on a grid of (0, 1/2]
PASS A'(q) -> sqrt2 as q -> 0: |A'(1e-8) - sqrt2| < 1e-7
  k=10: (a_k/sqrt2 - 1) * 4k = 0.972300
  k=100: (a_k/sqrt2 - 1) * 4k = 0.997099
  k=1000: (a_k/sqrt2 - 1) * 4k = 0.999708
== Part 4 (A.29: RQ-C C16) ==
  eta=0.0005: a* in [1.449062208, 1.449062208], theta_max = 1.1331805
PASS eta=0.0005: a* = 1.44906 (5 decimals)
PASS eta=0.0005: theta_max = 1.13318 (5 decimals)
  eta=0.0018: a* in [1.481593018, 1.481593018], theta_max = 1.0398715
PASS eta=0.0018: a* = 1.48159 (5 decimals)
PASS eta=0.0018: theta_max = 1.03987 (5 decimals)
  eta=0.0027: a* in [1.497494257, 1.497494257], theta_max = 1.0050625
PASS eta=0.0027: a* = 1.49749 (5 decimals)
PASS eta=0.0027: theta_max = 1.00506 (5 decimals)
  eta=0.0044: a* in [1.522027121, 1.522027121], theta_max = 0.95938464
PASS eta=0.0044: a* = 1.52203 (5 decimals)
PASS eta=0.0044: theta_max = 0.95938 (5 decimals)
  eta=0.0087: a* in [1.569970347, 1.569970347], theta_max = 0.88820287
PASS eta=0.0087: a* = 1.56997 (5 decimals)
PASS eta=0.0087: theta_max = 0.88820 (5 decimals)
  theta=1.0: eta threshold = 0.0028567004
PASS theta=1.0 needs eta < 0.00286
  theta=0.9: eta threshold = 0.0078156129
PASS theta=0.9 needs eta < 0.00782
  theta=0.8: eta threshold = 0.018254452
PASS theta=0.8 needs eta < 0.0183
  theta=1.0, eta=0.0044, K=0.9825 d_1.5075 + 0.0175 d_0.9999: a>=theta>b>m: True; E|Z| = 0.8535963596, E|Z|-g(lam+) = 0.000143926, E|Z|-C = 0.000232475
FINDING (quoted value false as written) C16 instance theta=1.0, eta=0.0044: violates (ID-theta) with the margins [('EZ', '0.853596'), ('dg', '1.44e-4'), ('dC', '2.32e-4')]
  theta=0.97, eta=0.0044, K=0.995 d_1.5175 + 0.005 d_0.9699: a>=theta>b>m: True; E|Z| = 0.8534274569, E|Z|-g(lam+) = 8.62674e-6, E|Z|-C = 6.35720e-5
PASS C16 instance theta=0.97, eta=0.0044: violates (ID-theta) with the margins [('ex', '8.6e-6')]
  theta=1.02, eta=0.0027, K=0.995 d_1.4926 + 0.005 d_1.0199: a>=theta>b>m: True; E|Z| = 0.8551465239, E|Z|-g(lam+) = 1.21324e-5, E|Z|-C = 8.26389e-5
PASS C16 instance theta=1.02, eta=0.0027: violates (ID-theta) with the margins [('ex', '1.2e-5')]
  theta=1.1, eta=0.0027, K=0.99 d_1.49 + 0.01 d_1.09: a>=theta>b>m: True; E|Z| = 0.8552952134, E|Z|-g(lam+) = 0.000232075, E|Z|-C = 0.000231328
PASS C16 instance theta=1.1, eta=0.0027: violates (ID-theta) with the margins [('ex', '2.3e-4')]
  theta=1.05, eta=0.0018, K=0.9975 d_1.479 + 0.0025 d_1.0499: a>=theta>b>m: True; E|Z| = 0.8560058525, E|Z|-g(lam+) = 4.11033e-6, E|Z|-C = 4.19676e-5
PASS C16 instance theta=1.05, eta=0.0018: violates (ID-theta) with the margins [('ex', '4.1e-6')]
  theta=1.1, eta=0.0018, K=0.9775 d_1.4645 + 0.0225 d_1.0999: a>=theta>b>m: True; E|Z| = 0.8561614615, E|Z|-g(lam+) = 0.000180460, E|Z|-C = 0.000197577
PASS C16 instance theta=1.1, eta=0.0018: violates (ID-theta) with the margins [('ex', '1.8e-4')]
  theta=1.2, eta=0.0005, K=0.9825 d_1.43625 + 0.0175 d_1.1999: a>=theta>b>m: True; E|Z| = 0.8573636231, E|Z|-g(lam+) = 9.75579e-5, E|Z|-C = 9.97381e-5
FINDING (quoted value false as written) C16 instance theta=1.2, eta=0.0005: violates (ID-theta) with the margins [('ex', '9.8e-5')]
  theta=1.2, eta=0.0005, K=0.9825 d_1.43625 + 0.0175 d_1.1999: a>=theta>b>m: True; E|Z| = 0.8573636231, E|Z|-g(lam+) = 9.75579e-5, E|Z|-C = 9.97381e-5
PASS C16 instance theta=1.2, eta=0.0005: violates (ID-theta) with the margins [('ex', '9.7e-5')]
  theta=1.0, eta=0.0044, K=0.9825 d_1.5075 + 0.0175 d_0.9999: a>=theta>b>m: True; E|Z| = 0.8535963596, E|Z|-g(lam+) = 0.000143926, E|Z|-C = 0.000232475
PASS C16 instance theta=1.0, eta=0.0044: violates (ID-theta) with the margins [('EZ', '0.853596'), ('dg', '1.43e-4'), ('dC', '2.32e-4')]
  below threshold: theta=0.95, eta=0.0044: E|Z| - max(g(lam+), C) = -1.69006e-5 (E|Z| - g = -1.6901e-5, E|Z| - C = -7.4387e-6); CLAIMS quotes -7.4e-6
PASS below threshold theta=0.95, eta=0.0044: no violation at the quoted grid point
  below threshold: theta=1.0, eta=0.0027: E|Z| - max(g(lam+), C) = -9.57899e-6 (E|Z| - g = -9.5790e-6, E|Z| - C = 1.3326e-5); CLAIMS quotes -9.6e-6
PASS below threshold theta=1.0, eta=0.0027: no violation at the quoted grid point
ALL PASS
