tri_int.c running Triangle P1(1,1) P2(3,2.5) P3(2,0.5) Length 1 2 =2.5 Length from 3 to 1 2 =1 Area of triangle = 1.25 Area by points = 1.25 xmin=1, xmax=3, ymin=0.5, ymax=2.5 n=100, hx=0.02, hy=0.02 f1(x,y)=x+2*y+3 integral f1(x,y) over triangle = 9.58408, nn=3125 exact integral=9.58333, error=0.000745933 f2(x,y)=x*x+2*y*y+3*x*y+4*x+5*y+6 integral f2(x,y) over triangle = 46.4182, nn=3125 exact integral=46.4062, error=0.0119836 f3(x,y)=x*x*x+2*y*y*y+3*x*x*y+4*x*y*y+5*x*x+6*y*y+7*x*y+ 8*x+9*y+10 integral f3(x,y) over triangle = 176.059, nn=3125 exact integral=175.99, error=0.0697327 fe(x,y)=exp(x)*exp(y) integral fe(x,y) over triangle = 48.6179, nn=3125 exact integral=48.5116, error=0.106249 linear,first order integral=9.58333, using x=2, y=1.33333 exact integral=9.58333, error=3.33333e-10 quad,first order integral=45.2778, using x=2, y=1.33333 exact integral=46.4062, error=-1.12847 cubic,first order integral=162.87, using x=2, y=1.33333 exact integral=175.99, error=-13.1192 exp,first order integral=35.0395, using x=2, y=1.33333 exact integral=48.5116, error=-13.4721 linear,second order integral=9.58333, using 3 b points exact integral=9.58333, error=3.33333e-10 quad,second order integral=46.4062, using 3 b points exact integral=46.4062, error=0 cubic,second order integral=175.104, using 3 b points exact integral=175.99, error=-0.885417 exp,second order integral=44.4196, using 3 b points exact integral=48.5116, error=-4.09205 linear,second order integral=9.72222, using 3 c points exact integral=9.58333, error=0.138889 quad,second order integral=48.5012, using 3 c points exact integral=46.4062, error=2.09491 cubic,second order integral=192.033, using 3 c points exact integral=175.99, error=16.0436 exp,second order integral=61.8566, using 3 c points exact integral=48.5116, error=13.345 third order integral=61.8566, using 3 c and a points quartic O(h^5) f1 integral=9.58333, using 3 c and 3 d points exact integral=9.58333, error=-1.14742e-07 quartic O(h^5) f2 integral=46.4062, using 3 c and 3 d points exact integral=46.4062, error=-6.71541e-07 quartic O(h^5) f3 integral=175.99, using 3 c and 3 d points exact integral=175.99, error=-3.09768e-06 quartic O(h^5) fe integral=48.5326, using 3 c and 3 d points exact integral=48.5116, error=0.0209341 nvert=3, npoly=1 f1 split integral=9.58333, using 1 points f2 split integral=45.2778, using 1 points f3 split integral=162.87, using 1 points fe split integral=35.0395, using 1 points nvert=6, npoly=4 f1 split integral=9.58333, using 4 points f2 split integral=46.1241, using 4 points f3 split integral=172.784, using 4 points fe split integral=44.9134, using 4 points nvert=18, npoly=16 f1 split integral=9.58333, using 16 points f2 split integral=46.3357, using 16 points f3 split integral=175.193, using 16 points fe split integral=47.6067, using 16 points nvert=66, npoly=64 f1 split integral=9.58333, using 64 points f2 split integral=46.3886, using 64 points f3 split integral=175.791, using 64 points fe split integral=48.2853, using 64 points nvert=258, npoly=256 f1 split integral=9.58333, using 256 points, error=3.33332e-10 f2 split integral=46.4018, using 256 points, error=-0.00440809 f3 split integral=175.94, using 256 points, error=-0.0497157 fe split integral=48.455, using 256 points, error=-0.0565862 triquad with coordinate shift triquad f1 order=1 integral=9.58331 exact integral=9.58333, error=-2.0833e-05 triquad f2 order=1 integral=45.2776 exact integral=46.4062, error=-1.12869 triquad f3 order=1 integral=162.869 exact integral=175.99, error=-13.1205 triquad fe order=1 integral=35.0391 exact integral=48.5116, error=-13.4726 triquad f1 order=2 integral=9.58333 exact integral=9.58333, error=-2.22075e-06 triquad f2 order=2 integral=46.4062 exact integral=46.4062, error=-2.74462e-05 triquad f3 order=2 integral=175.989 exact integral=175.99, error=-0.000179137 triquad fe order=2 integral=47.9104 exact integral=48.5116, error=-0.601239 triquad f1 order=3 integral=9.58348 exact integral=9.58333, error=0.000145064 triquad f2 order=3 integral=46.407 exact integral=46.4062, error=0.000756211 triquad f3 order=3 integral=175.993 exact integral=175.99, error=0.0030211 triquad fe order=3 integral=48.5022 exact integral=48.5116, error=-0.00939934 triquad f1 order=4 integral=9.58336 exact integral=9.58333, error=2.27616e-05 triquad f2 order=4 integral=46.4064 exact integral=46.4062, error=0.000131875 triquad f3 order=4 integral=175.99 exact integral=175.99, error=0.000585223 triquad fe order=4 integral=48.5117 exact integral=48.5116, error=0.000125853 triquad f1 order=5 integral=9.58333 exact integral=9.58333, error=1.35984e-06 triquad f2 order=5 integral=46.4063 exact integral=46.4062, error=2.7785e-05 triquad f3 order=5 integral=175.99 exact integral=175.99, error=0.000205958 triquad fe order=5 integral=48.5118 exact integral=48.5116, error=0.000158248