3
$\begingroup$

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.

$\endgroup$

1 Answer 1

8
$\begingroup$

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

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.