神話の翼
program-id. chaos02.
data division.
working-storage section.
01 i pic 9(6).
01 a pic s9v999999.
01 b pic s9v999999.
01 t comp-2.
01 x0 comp-2.
01 x1 comp-2.
01 y0 comp-2.
01 y1 comp-2.
01 ad pic x(20).
procedure division.
display "Chaos02 Shinwa no Tsubasa" upon syserr
display 'a=' upon syserr no advancing accept ad compute a = function numval(ad)
display 'b=' upon syserr no advancing accept ad compute b = function numval(ad)
compute x0 = 0.1 compute y0 = 0
perform varying i from 1 by 1 until i > 50000
compute x1 = y0 + a * x0 - 5.0 / (x0 * x0 + 1) + 6.0 + 0.2 * function exp(-y0 * y0)
compute y1 = -b*x0
display x1 ' ' y1
compute x0 = x1 compute y0 = y1
end-perform
exit program.
gnuplot -p -e "plot 'tmp' ps 0 lt rgb 'gold'"
gnuplot -p -e "set title 'a=-1.60 b=0.99'; plot 'tmp' ps 0 lt rgb 'red'"
gnuplot -p -e "set title 'a=-1.844 b=0.97'; plot 'tmp' ps 0 lt rgb 'green'"
gnuplot -p -e "set title 'a=0.02 b=0.97'; plot 'tmp' ps 0 lt rgb 'blue'"
![Default](https://d3caz7hhiepl95.cloudfront.net/assets/user/default-6344dcd9594efe2c770024a51c383175.png)