I’m reading the paper Explicit estimates for the Riemann zeta function close to the 1-line (arXiv:2312.09412), and on page 6, the authors define the following expressions:
$w_1 \geq max _{t\geq t_0}\frac{8 \log \log t}{\log t}$
$w_2 = \begin{cases} \displaystyle \frac{1 - \frac{1}{e} + \frac{\log w_1}{\log \log t_0}}{w_1 \log 2}, & \text{if } w_1 < 1, \\ \displaystyle \frac{1 - \frac{1}{e}}{w_1 \log 2}, & \text{if } w_1 \geq 1, \end{cases} $
$B = 1 + \frac{8}{3w_1}$
$A_k = 1.546 \cdot \zeta\left(1 + k\right) \cdot\left(1+\frac{2+k} {t_0}\right)^{1/6} \cdot \left(1 + \frac{2 + k}{t_0 \log t_0} \right) \cdot \left(1 + \frac{2 \sqrt{1 + k}}{t_0} \right)$
I would like to compute these quantities in MATLAB for given values of and k. For example, if and k = 1.5, the approximate expected outputs (based on the paper) are: $w_1=\frac{8}{e}$ $w_2 = 0.309$ $B = 1.91$ $A_k = 10$
My MATLAB code
****% Inputs****
t0 = sym(3);
k = sym(1.5);
e = exp(sym(1));
w1 = (8/e);
log2 = log(sym(2));
***% Compute w2***
if w1 < 1
w2 = (1 - 1/e + log(w1) / log(log(t0))) / (w1 * log2);
else
w2 = (1 - 1/e) / (w1 * log2);
end
***% Compute zeta(s)***
s = 1 + k;
zeta_val = zeta(s);
***% Compute B***
B = 1 + 8 / (3 * w1);
***% Compute A_k***
Ak = sym(1546)/sym(10)^3 * zeta_val * (1 + (2 +
k)/t0)^(1/sym(6)) ...
* (1 + (2 + k) / (t0 * log(t0))) ...
* (1 + 2 * sqrt(1 + k) / t0);
***% Display results***
fprintf('For t0 = %.2f and k = %d:\n', t0, k);
fprintf('w1 = %.8f\n', w1);
fprintf('w2 = %.8f\n', w2);
fprintf('zeta(s) = %.8f at s = %.8f\n', zeta_val, s);
fprintf('B = %.8f\n', B);
fprintf('A_k = %.8f\n', Ak);
*** The results are***
For t0 = 3.00
k = 2:
w1 = 2.94303553
w2 = 0.30986958
zeta(s) = 1.34148726 at s = 2.50000000
B = 1.90609394
A_k = 9.99214293
My questions : Is this implementation correct and numerically stable?
sym) usually is that you don't need to worry about numerical stability; you can just power through it by setting the number of digits high enough. $\endgroup$