demos/pi

Finds an integer arithmetic based approximation to pi,
such as 3+1/7, using 1 2 3 5 7 + - * / (protected division)

To run the demo, simply enter the following command
unix-prompt% perlgp-run.pl &

which can be converted with suitable software to a rational approximation,
such as 355/113.

Note that it will find a 'perfect' solution at around 1e-16 error,
because this is the limit of double precision floating point numbers
in (normal) Perl.


to plot progress use

plot-tlog.pl -logs y [-refresh 20]
gnuplot -persist plot-evparams.gp  -or-  gnuplot plot-evparams.gpr
gnuplot -persist plot-fitdist.gp  -or-  gnuplot plot-fitdist.gpr


Here's a solution with 8.9e-15 error

(pdiv(((3 - pdiv(1,(((3 - pdiv(1,(pdiv((((2 - 2) + pdiv(((2 -
pdiv(5,(((2 - pdiv(1,(pdiv((3 - pdiv(2,5*1*(3*7 + 2))),7) + (5*7 +
7)))) + (5*2 + 7)*3) - 1))) - 3),7)) + 3),3) + ((7*5 + 3) + 3)))) +
(7*5 + 2)*3) - 1))) - 2),7) + 3);

which Maple simplifies to

 79287081352
 -----------
 25237861841


