/* Circle z = 4*sin(x) Here we also test the user defined function my_sin/1. Solution: code = (4 * sin(X)) = [[[0.0],0.0],[[0.05],0.199916677082713],[[0.1],0.399333666587313],[[0.15],0.597752529894397],[[0.2],0.794677323180245],[[0.25],0.989615837018092],[[0.3],1.182080826645358],[[0.35],1.371591229821805],[[0.4],1.557673369234602],[[0.45],1.739862136444921],[[0.5],1.917702154416812],[[0.55],2.090748915722637],[[0.6],2.258569893580141],[[0.65],2.420745622944158],[[0.7],2.576870748950764],[[0.75],2.726555040093336],[[0.8],2.869424363598091],[[0.85],3.005121620561171],[[0.9],3.133307638509934],[[0.95],3.253662019157495],[[1.0],3.365883939231586]] = [[1.0] = 3.365883939231586] code = (4 * my_sin(X)) = [[[0.0],0.0],[[0.05],0.199916677082713],[[0.1],0.399333666587313],[[0.15],0.597752529894397],[[0.2],0.794677323180245],[[0.25],0.989615837018092],[[0.3],1.182080826645358],[[0.35],1.371591229821805],[[0.4],1.557673369234602],[[0.45],1.739862136444921],[[0.5],1.917702154416812],[[0.55],2.090748915722637],[[0.6],2.258569893580141],[[0.65],2.420745622944158],[[0.7],2.576870748950764],[[0.75],2.726555040093336],[[0.8],2.869424363598091],[[0.85],3.005121620561171],[[0.9],3.133307638509934],[[0.95],3.253662019157495],[[1.0],3.365883939231586]] = [[1.0] = 3.365883939231586] Cf http://hakank.org/jgap/circle_1.conf */ data(circle,Data,Vars,Unknown,Ops,Constants,MaxC) :- N = 20, Data = [[[X/N],4*sin(X/N)] : X in 0..N], println(data=Data), get_global_map().put("use_approx",0.01), % get_global_map().put("debug",true), Vars = ["X"], Unknown = [1.0], Ops = new_map([infix=["*"], op1=["sin","my_sin"] ]), Constants = 0..10, MaxC = 3.