Feigenbaum constant calculation: Difference between revisions

m
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 244:
{{out}}
<pre>Same as FreeBASIC entry.</pre>
 
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
{{trans|FreeBASIC}}
<syntaxhighlight lang="qbasic">100 cls
110 mit = 13
120 mitj = 13
130 a1 = 1
140 a2 = 0
150 d = 0
160 d1 = 3.2
170 print "Feigenbaum constant calculation:"
180 print
190 print " i d"
200 print "==================="
210 for i = 2 to mit
220 a = a1+(a1-a2)/d1
230 for j = 1 to mitj
240 x = 0
250 y = 0
260 for k = 1 to 2^i
270 y = 1-2*y*x
280 x = a-x*x
290 next k
300 a = a-(x/y)
310 next j
320 d = (a1-a2)/(a-a1)
330 print using "###";i;" ";
335 print using "##.#########";d
340 d1 = d
350 a2 = a1
360 a1 = a
370 next i
380 end</syntaxhighlight>
 
==={{header|Just BASIC}}===
Line 270 ⟶ 304:
a1 = a
next i</syntaxhighlight>
 
==={{header|MSX Basic}}===
{{works with|MSX BASIC|any}}
{{trans|FreeBASIC}}
<syntaxhighlight lang="qbasic">100 CLS
110 mit = 13
120 mitj = 13
130 a1 = 1
140 a2 = 0
150 d = 0
160 d1 = 3.2
170 PRINT "Feigenbaum constant calculation:"
180 PRINT
190 PRINT " i d"
200 PRINT "==================="
210 FOR i = 2 TO mit
220 a = a1 + (a1 - a2) / d1
230 FOR j = 1 TO mitj
240 x = 0
250 y = 0
260 FOR k = 1 TO 2 ^ i
270 y = 1 - 2 * y * x
280 x = a - x * x
290 NEXT k
300 a = a - (x / y)
310 NEXT j
320 d = (a1 - a2) / (a - a1)
330 PRINT USING "### ##.#########"; i; d
340 d1 = d
350 a2 = a1
360 a1 = a
370 NEXT i
380 END</syntaxhighlight>
 
==={{header|True BASIC}}===
Line 574 ⟶ 641:
13 1.40115519 4.66920555
</pre>
 
=={{header|EasyLang}}==
{{trans|AWK}}
<syntaxhighlight>
numfmt 6 0
a1 = 1 ; a2 = 0 ; d1 = 3.2
ipow2 = 4
for i = 2 to 13
a = a1 + (a1 - a2) / d1
for j = 1 to 10
x = 0 ; y = 0
for k = 1 to ipow2
y = 1 - 2 * y * x
x = a - x * x
.
a -= x / y
.
d = (a1 - a2) / (a - a1)
print i & " " & d
d1 = d ; a2 = a1 ; a1 = a
ipow2 *= 2
.
</syntaxhighlight>
 
=={{header|F#|F sharp}}==
Line 768 ⟶ 858:
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Feigenbaum_constant_calculation}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
'''Solution'''
 
[[File:Fōrmulæ - Feigenbaum constant calculation 01.png]]
 
'''Test case'''
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
[[File:Fōrmulæ - Feigenbaum constant calculation 02.png]]
In '''[https://formulae.org/?example=Feigenbaum_constant_calculation this]''' page you can see the program(s) related to this task and their results.
 
[[File:Fōrmulæ - Feigenbaum constant calculation 03.png]]
 
=={{header|FutureBasic}}==
Line 2,141 ⟶ 2,236:
{{trans|Ring}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
 
var feigenbaum = Fn.new {
1,969

edits