Talk:Steffensen's method: Difference between revisions

From Rosetta Code
Content added Content deleted
(Additional note)
(→‎Max iterations: Realised why it was correct, doh!)
Tag: Blanking
 
Line 1: Line 1:
==Max iterations==

In the ATS and RATFOR samples and most of the others derived from them, the loop in the steffensen_aitken method appears to run from 1 to maxiter - 1<br>
E.g., in the ATS sample:
<pre>
...
var iter : int = 1 (* iteration counter *)
in
while (abs (p - p0) > tol andalso iter < maxiter)
begin
p0 := p;
p := aitken (f, p0);
iter := iter + 1
end;
...
</pre>

I was just wondering if that should be <code>iter <= maciter</code> (or <code>var iter : int = 0</code>) in the while loop?<br>
Or am I missing something?

The results appear unaffected either way (to 6 decimal places)

--[[User:Tigerofdarkness|Tigerofdarkness]] ([[User talk:Tigerofdarkness|talk]]) 21:47, 5 June 2023 (UTC)

Latest revision as of 22:04, 5 June 2023