# Precision error in ND package

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 NumericalCalculusPrivatet\$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.

• 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. Sep 26, 2023 at 20:01