# set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 # set output 'bivariat.2.png' set key inside right bottom vertical Right noreverse enhanced autotitles nobox set samples 50, 50 set title "approximate the integral of functions" 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)=cos(x) 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.) 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