I am trying to compute t0:

eq[n_, β_, λ_] := Hypergeometric1F1[1/2 (1 - λ/β), n + 1, β/2]
EDL[n_, β_, k_Integer: 1] := λ /. FindRoot[eq[n, β, λ] == 0, {λ, (2 k - 1) β}]
t0 = Table[EDL[0, β, 1], {β, 50, 100}]

When I tried this code I have a problem for $\beta$=(82, ..., 97), the answer is not accurate and I got the error message:

FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the merit function. You may need more than MachinePrecision digits of working precision to meet these tolerances.

So, I want to change the machine precision, so I tried:

t0 = SetPrecision[Table[EDL[0, β, 1], {β, 50, 100}], 30]

But I still have a problem. Please help me to change and set the machine precision.


1 Answer 1


Setting the option WorkingPrecision->30 in FindRoot does exactly what you want and removes the error message.


Your Answer

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

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