/* Pi # Encyclopedia of Integer Sequences http://www.research.att.com/~njas/sequences/A000796 L. Grebelius, Approximation of Pi: First 1000000 digits http://www2.tripnet.se/~nlg/pi0001.htm * n=1 stop_criteria 'generations' reached gen = 137 (time: 3.101s) results_best = [[261.391780913058483,floor(A * atan2(atan(floor(-4.444505783936244)),A)) - -6.048972614132321]] * n=2 stop_criteria 'generations' reached gen = 335 (time: 45.831s) results_best = [[252.862094557284081,atan2(6.01300757192681,A) * 4.507928953742574]] * n=3 stop_criteria=generations gen = 356 (time: 92.386s) results_best = [[253.447261808092605,B / (8.534174011337651 + floor(-8.872583610412004 - 1.633200129323267)) + 6.670751681863681]] * Using constants X=0..0.1..10 gen = 68407 (time: 5627.441s) results_best = [[239.649990383578768,atan2(2.100000000000001,sin(tan(tan(A)))) * atan2(C,3.200000000000002 - floor(8.099999999999987 + 7.999999999999988))]] Cf pi1.conf */ import util. data(pi1,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Seq = [3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,8,4,1,9,7,1,6,9,3,9,9,3,7,5,1,0,5,8,2,0,9,7,4,9,4,4,5,9,2,3,0,7,8,1,6,4,0,6,2,8,6,2,0,8,9,9,8,6,2,8,0,3,4,8,2,5,3,4,2,1,1,7,0,6,7,9,8,2,1,4], % member(N,1..3), % println(n=N), make_seq(Seq,4,Data,Unknown,Vars), Ops = [+,-,*,/,if_then_else,sin,tan,atan,atan2,log,exp,floor], % Constants = [frand(-10,10) : _ in 1..10], Constants = 0..0.1..10, MaxSize = 11, Params = new_map([aapprox=0.1, init_size=200, show_best=1, crossover_rate=0.5, mutation_rate=0.5, num_gens=1800, show_only_improvements=true, % stop_criteria=generations, % debug=true, remove_dups=true ]).