// Upper bound for G(u) = min(1, f1(u/2))^2 * u/(u - 2e^gamma) on u > 4 (the JR-route envelope of c*_real with F_2 >= 1). // On (4,8]: f1(u/2) = 2e^g log(u/2-1)/(u/2) <= 1, so G = 16 e^{2g} log^2(u/2-1) / (u (u - 2e^g)); numerator increasing, denominator // increasing (u > 2e^g), so on a cell [a,b]: G <= 16 E^2 log^2(b/2-1) / (a (a - 2E)), E = 1.78108 > e^gamma (e^gamma = 1.7810724...). // On (8,inf): f1 <= 1 and u/(u-2e^g) decreasing, so G <= 8/(8-2E). Floating point with outward margin 1e-9 (measured, not exact rational). const E = 1.78108, M = 1e-9, n = +(process.argv[2] || 256); let worst = 0, at = null; for (let k = 0; k < n; k++) { const a = 4 + 4 * k / n, b = 4 + 4 * (k + 1) / n; const L = Math.log(b / 2 - 1); const g = 16 * E * E * L * L / (a * (a - 2 * E)); const ub = g * (1 + M) + M; if (ub > worst) { worst = ub; at = [a, b]; } } const tail = 8 / (8 - 2 * E) * (1 + M) + M; console.log(JSON.stringify({ cells: n, E_upper: E, sup_4_8_upper: worst, worst_cell: at, tail_8_inf_upper: tail, overall: Math.max(worst, tail) }));