Anonymous user
Feigenbaum constant calculation: Difference between revisions
m
→{{header|REXX}}: changed output text, optimized the DO loops.
m (→{{header|REXX}}: changed some comments, increased the number of decimal digits for computations.) |
m (→{{header|REXX}}: changed output text, optimized the DO loops.) |
||
Line 465:
=={{header|REXX}}==
{{trans|Sidef}}
<lang rexx>/*REXX pgm calculates the
parse arg digs maxi maxj . /*obtain optional argument from the CL.*/
if maxi=='' | maxi=="," then maxi=15 /*Not specified? Then use the default.*/
Line 475:
d1= 3.2
pad= left('', 3) /*literal for spacing between values. */
say 'Using ' maxj " iterations for " j', with ' digits() " decimal digits
say
say center('i',9,"─") pad center('d',digs+1,"─") /*show a centered title for I and D.*/
Line 481:
do i=2 for maxi-1
a= a1 + (a1 - a2) / d1
do j=1
x= 0; y= 0
do k=1
y= 1 - 2 * y * x
x= a - x**2
Line 497:
{{out|output|text= when using the default inputs:}}
<pre>
Using 10 iterations for J, with 40 decimal digits
────i──── ────────────────────d────────────────────
|