Feigenbaum constant calculation: Difference between revisions

Content added Content deleted
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(Added XPL0 example.)
Line 2,013: Line 2,013:
feigenbaum.call()</syntaxhighlight>
feigenbaum.call()</syntaxhighlight>


{{out}}
<pre>
i d
2 3.21851142
3 4.38567760
4 4.60094928
5 4.65513050
6 4.66611195
7 4.66854858
8 4.66906066
9 4.66917155
10 4.66919515
11 4.66920026
12 4.66920098
13 4.66920537
</pre>

=={{header|XPL0}}==
{{trans|Wren}}
<syntaxhighlight lang "XPL0">def MaxIt = 13, MaxItJ = 10;
real A, A1, A2, D, D1, X, Y;
int I, J, K;
[A1:= 1.; A2:= 0.; D1:= 3.2;
Text(0, " i d^m^j");
for I:= 2 to MaxIt do
[A:= A1 + (A1-A2)/D1;
for J:= 1 to MaxItJ do
[X:= 0.; Y:= 0.;
for K:= 1 to 1<<I do
[Y:= 1. - 2.*Y*X;
X:= A - X*X;
];
A:= A - X/Y;
];
D:= (A1-A2) / (A-A1);
Format(2, 0); RlOut(0, float(I));
Format(5, 8); RlOut(0, D);
CrLf(0);
D1:= D;
A2:= A1;
A1:= A;
];
]</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>