// job #6: exact G2(x#) from `node research/exact-g2-ladder.js` section 1 against the // shape of the bound G2(x#) <<_eps x^(beta2+eps). The bound is asymptotic with an // inexplicit C(eps), so this only catches a wrong exponent direction; it is a // measurement over x <= 43, not a check of the theorem. // Usage: node bound-shape.js ladder.out 'use strict'; const fs = require('fs'); const BETA2 = 4.26645028414864191641; // Booker-Browning lower truncation; double precision here const rows = []; let inSec = false; for (const line of fs.readFileSync(process.argv[2] || 'ladder.out', 'utf8').split('\n')) { if (line.startsWith('=== 1.')) { inSec = true; continue; } if (inSec && line.startsWith('===')) break; const m = inSec && line.match(/^(\d+)\s+(\d+)\s+\d+\s+\d+\s+true\s+\+(\d+)\s+YES$/); if (m) rows.push({ x: +m[1], g2: +m[2], next: +m[3] }); } if (rows.length === 0) throw new Error('no section-1 rows parsed'); console.log('x G2 x^beta2 (x+1)^beta2 G2/x^beta2 log G2/log x'); let worst = null, belowAll = true; for (const { x, g2, next } of rows) { if (next !== g2) throw new Error(`row x=${x}: next slot +${next} != G2 ${g2}`); const b = x ** BETA2, b1 = (x + 1) ** BETA2, r = g2 / b; if (!(g2 < b)) belowAll = false; if (!worst || r > worst.r) worst = { x, r }; console.log(`${String(x).padEnd(3)} ${String(g2).padEnd(5)} ${b.toExponential(6).padEnd(16)} ${b1.toExponential(6).padEnd(16)} ${r.toExponential(6).padEnd(13)} ${(Math.log(g2) / Math.log(x)).toFixed(6)}`); } console.log(`rows ${rows.length} (x = ${rows[0].x}..${rows[rows.length - 1].x}); every G2 < x^beta2: ${belowAll}; largest G2/x^beta2 = ${worst.r.toExponential(6)} at x = ${worst.x}`);