Feigenbaum constant calculation: Difference between revisions

no edit summary
(Feigenbaum constant calculation in various BASIC dialents (BASIC256, Just BASIC, True BASICc and Yabasic))
No edit summary
Line 713:
 
In '''[https://formulae.org/?example=Feigenbaum_constant_calculation this]''' page you can see the program(s) related to this task and their results.
 
 
=={{header|FutureBasic}}==
{{trans|Ring and Phix}}
<lang futurebasic>
window 1, @"Feignenbaum Constant", ( 0, 0, 200, 300 )
 
_maxIt = 13
_maxItJ = 10
 
void local fn Feignenbaum
NSUInteger i, j, k
double a1 = 1.0, a2 = 0.0, d1 = 3.2
 
print "Feignenbaum Constant"
print " i d"
 
for i = 2 to _maxIt
double a = a1 + ( a1 - a2 ) / d1
for j = 1 to _maxItJ
double x = 0, y = 0
for k = 1 to fn pow( 2, i )
y = 1 - 2 * y * x
x = a - x * x
next
a = a - x / y
next
double d = ( a1 - a2 ) / ( a - a1 )
printf @"%2d. %.8f", i, d
d1 = d
a2 = a1
a1 = a
next
end fn
 
fn Feignenbaum
 
HandleEvents
</lang>
{{output}}
<pre>
Feignenbaum Constant
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|Go}}==
Line 760 ⟶ 817:
13 4.66920537
</pre>
 
 
=={{header|Groovy}}==
715

edits