Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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