0
$\begingroup$

Based on the helpful answers to this question, I wrote the code below to compute zeros of the derivative of the Riemann zeta function, high in the critical strip

<< NumericalCalculus`

ZetaPrime[s0_?NumericQ] := 
 ND[Zeta[s], {s, 1}, s0, Method -> NIntegrate, Scale -> 1/10, 
  WorkingPrecision -> 30]

ArgZetaPrime[s_] := ArgZetaPrime[s] = Arg[ZetaPrime[s]]

Do[
 boxes = 
  Table[{ii + I *jj, ii + 1/10 + I *(jj + 1/10)}, {ii, 4/10, 31/10, 
    1/10}];
 argprinciple = 
  Table[Round[(Mod[
        ArgZetaPrime[boxes[[kk + 1, 1]]] - 
         ArgZetaPrime[boxes[[kk, 1]]], 2 Pi, -Pi] + 
       Mod[
        ArgZetaPrime[boxes[[kk, 2]]] - 
         ArgZetaPrime[boxes[[kk + 1, 1]]], 2 Pi, -Pi] + 
       Mod[
        ArgZetaPrime[boxes[[kk - 1, 2]]] - 
         ArgZetaPrime[boxes[[kk, 2]]], 2 Pi, -Pi] + 
       Mod[
        ArgZetaPrime[boxes[[kk, 1]]] - 
         ArgZetaPrime[boxes[[kk - 1, 2]]], 2 Pi, -Pi])/(2 Pi)], {kk, 
    2, Length[boxes] - 1}];
 If[MemberQ[argprinciple, 1],
  PrependTo[argprinciple, 0]; AppendTo[argprinciple, 0];
  goodboxes = Pick[boxes, argprinciple, 1];
  zero = 
   FindRoot[ZetaPrime[s], {s, Mean[#], Sequence @@ #}, 
       WorkingPrecision -> 30] & /@ goodboxes // Flatten;
  Print[zero, " ", SetPrecision[ZetaPrime[s] /. zero, 15]]]
 , {jj, 4992381, 4992381 - 1, -1/10}]

I'm getting the following error message

NIntegrate::precw: The precision of the argument function ((1.7713932533600079702+0.2353048432137065153 I) E^(-I NumericalCalculus`Private`t$6607)) is less than WorkingPrecision (30.`).

I don't understand this, because I'm not passing anything to the ND that is not integer or rational.


Edit: As the comment below points out, I want to use FindRoot (with a TBA choice of WorkingPrecision) to find a root of function computed via the ND package (with its own TBA choice of WorkingPrecision.) How do these two choices relate? Should they be the same? The ND package does not have an AccuracyGoal or PrecisionGoal option.

$\endgroup$
1
  • $\begingroup$ I don't know why but passing WorkingPrecision -> 40 into FindRoot seems to suppress the precision messages (despite still working in precision 30 in ZetaPrime). So perhaps somewhere along the way there's some precision loss happening somewhere. $\endgroup$
    – Greg Hurst
    Sep 26, 2023 at 20:01

1 Answer 1

0
$\begingroup$

The first call to ZetaPrime uses the infinite precision inputs, but ND calls NIntegrate which gives lower precision output, and FindRoot calls ND multiple times based on this. Method->NIntegrate is actually a poor choice here; it is too sophisticated to return values close to zero with an error of about the same size. Method->EulerSUm is faster and does not worry about the size of the answer relative to the size of the error.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.