# set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 10 mousing name "bivariat_7" butt solid # set output 'bivariat.7.svg' set samples 59, 59 set title "Greatest Common Divisor (for integers only)" integral_f(x) = (x>0)?int1a(x,x/ceil(x/delta)):-int1b(x,-x/ceil(-x/delta)) int1a(x,d) = (x<=d*.1) ? 0 : (int1a(x-d,d)+(f(x-d)+4*f(x-d*.5)+f(x))*d/6.) int1b(x,d) = (x>=-d*.1) ? 0 : (int1b(x+d,d)+(f(x+d)+4*f(x+d*.5)+f(x))*d/6.) f(x)=sin(x-1)-.75*sin(2*x-1)+(x**2)/8-5 integral2_f(x,y) = (xy-d*.5) ? 0 : (int2(x+d,y,d) + (f(x)+4*f(x+d*.5)+f(x+d))*d/6.) ack(m,n) = (m == 0) ? n + 1 : (n == 0) ? ack(m-1,1) : ack(m-1,ack(m,n-1)) min(x,y) = (x < y) ? x : y max(x,y) = (x > y) ? x : y gcd(x,y) = gcd1(rnd(max(x,y)),rnd(min(x,y))) rnd(x) = int(x+0.5) gcd1(x,y) = (y == 0) ? x : gcd1(y, x - x/y * y) delta = 0.2 GPFUN_integral_f = "integral_f(x) = (x>0)?int1a(x,x/ceil(x/delta)):-int1b(x,-x/ceil(-x/delta))" GPFUN_int1a = "int1a(x,d) = (x<=d*.1) ? 0 : (int1a(x-d,d)+(f(x-d)+4*f(x-d*.5)+f(x))*d/6.)" GPFUN_int1b = "int1b(x,d) = (x>=-d*.1) ? 0 : (int1b(x+d,d)+(f(x+d)+4*f(x+d*.5)+f(x))*d/6.)" GPFUN_integral2_f = "integral2_f(x,y) = (x