-- test_nuderiv4d.adb test nuderiv4d -- order 1 minimum points 5 -- order 2 minimum points 15 -- order 3 minimum points 35 -- order 4 minimum points 70 -- going beyond minimum points does not help much -- actually, current limit of nuderiv4d with Ada.Text_IO; use Ada.Text_IO; with Ada.Numerics.Long_Elementary_Functions; use Ada.Numerics.Long_Elementary_Functions; with Real_Arrays; use Real_Arrays; with Nuderiv4d; use Nuderiv4d; procedure Test_Nuderiv4d is n : integer := 69; -- need "g" for more points, generated by gen_data4 x : real_vector(0..n); y : real_vector(0..n); z : real_vector(0..n); t : real_vector(0..n); debug : integer := 0; order : integer := 4; U : real_vector(0..n); est, actual, dx : real; cx : real_vector(0..n); cy : real_vector(0..n); cz : real_vector(0..n); ct : real_vector(0..n); cxx : real_vector(0..n); cxy : real_vector(0..n); cxz : real_vector(0..n); cxt : real_vector(0..n); cyy : real_vector(0..n); cyz : real_vector(0..n); cyt : real_vector(0..n); czz : real_vector(0..n); czt : real_vector(0..n); ctt : real_vector(0..n); cxxx : real_vector(0..n); cxxy : real_vector(0..n); cxxz : real_vector(0..n); cxxt : real_vector(0..n); cxyy : real_vector(0..n); cxyz : real_vector(0..n); cxyt : real_vector(0..n); cxzz : real_vector(0..n); cxzt : real_vector(0..n); cxtt : real_vector(0..n); cyyy : real_vector(0..n); cyyz : real_vector(0..n); cyyt : real_vector(0..n); cyzz : real_vector(0..n); cyzt : real_vector(0..n); cytt : real_vector(0..n); czzz : real_vector(0..n); czzt : real_vector(0..n); cztt : real_vector(0..n); cttt : real_vector(0..n); cxxxx : real_vector(0..n); cxxxy : real_vector(0..n); cxxxz : real_vector(0..n); cxxxt : real_vector(0..n); cxxyy : real_vector(0..n); cxxyz : real_vector(0..n); cxxyt : real_vector(0..n); cxxzz : real_vector(0..n); cxxzt : real_vector(0..n); cxxtt : real_vector(0..n); cxyyy : real_vector(0..n); cxyyz : real_vector(0..n); cxyyt : real_vector(0..n); cxyzz : real_vector(0..n); cxyzt : real_vector(0..n); cxytt : real_vector(0..n); cxzzz : real_vector(0..n); cxzzt : real_vector(0..n); cxztt : real_vector(0..n); cxttt : real_vector(0..n); cyyyy : real_vector(0..n); cyyyz : real_vector(0..n); cyyyt : real_vector(0..n); cyyzz : real_vector(0..n); cyyzt : real_vector(0..n); cyytt : real_vector(0..n); cyzzz : real_vector(0..n); cyzzt : real_vector(0..n); cyztt : real_vector(0..n); cyttt : real_vector(0..n); czzzz : real_vector(0..n); czzzt : real_vector(0..n); czztt : real_vector(0..n); czttt : real_vector(0..n); ctttt : real_vector(0..n); error, maxerror : real; -- utility functions function max(a:real; b:real) return real is begin if a>b then return a; end if; return b; end max; -- test functions function f(x:real; y:real; z:real; t:real) return real is begin return x*x*x*x + 2.0*x*x*x*y + 3.0*x*x*x*z + 4.0*x*x*x*t + 5.0*x*x*y*y + 6.0*x*x*y*z + 7.0*x*x*y*t + 8.0*x*x*z*z + 9.0*x*x*z*t + 10.0*x*x*t*t + 11.0*x*y*y*y + 12.0*x*y*y*z + 13.0*x*y*y*t + 14.0*x*y*z*z + 15.0*x*y*z*t + 16.0*x*y*t*t + 17.0*x*z*z*z + 18.0*x*z*z*t + 19.0*x*z*t*t + 20.0*x*t*t*t + 21.0*y*y*y*y + 22.0*y*y*y*z + 23.0*y*y*y*t + 24.0*y*y*z*z + 25.0*y*y*z*t + 26.0*y*y*t*t + 27.0*y*z*z*z + 28.0*y*z*z*t + 29.0*y*z*t*t + 30.0*y*t*t*t + 31.0*z*z*z*z + 32.0*z*z*z*t + 33.0*z*z*t*t + 34.0*z*t*t*t + 35.0*t*t*t*t + 36.0*x*x*x + 37.0*x*x*y + 38.0*x*x*z + 39.0*x*x*t + 40.0*x*y*y + 41.0*x*y*z + 42.0*x*y*t + 43.0*x*z*z + 44.0*x*z*t + 45.0*x*t*t + 46.0*y*y*y + 47.0*y*y*z + 48.0*y*y*t + 49.0*y*z*z + 50.0*y*z*t + 51.0*y*t*t + 52.0*z*z*z + 53.0*z*z*t + 54.0*z*t*t + 55.0*t*t*t + 56.0*x*x + 57.0*x*y + 58.0*x*z + 59.0*x*t + 60.0*y*y + 61.0*y*z + 62.0*y*t + 63.0*z*z + 64.0*z*t + 65.0*t*t + 66.0*x + 67.0*y + 68.0*z + 69.0*t + 70.0; end f; function fx(x:real; y:real; z:real; t:real) return real is begin return 4.0*x*x*x + 6.0*x*x*y + 9.0*x*x*z + 12.0*x*x*t + 10.0*x*y*y + 12.0*x*y*z + 14.0*x*y*t + 16.0*x*z*z + 18.0*x*z*t + 20.0*x*t*t + 11.0*y*y*y + 12.0*y*y*z + 13.0*y*y*t + 14.0*y*z*z + 15.0*y*z*t + 16.0*y*t*t + 17.0*z*z*z + 18.0*z*z*t + 19.0*z*t*t + 20.0*t*t*t + 108.0*x*x + 74.0*x*y + 76.0*x*z + 78.0*x*t + 40.0*y*y + 41.0*y*z + 42.0*y*t + 43.0*z*z + 44.0*z*t + 45.0*t*t + 112.0*x + 57.0*y + 58.0*z + 59.0*t + 66.0; end fx; function fy(x:real; y:real; z:real; t:real) return real is begin return 15.0*x*z*t + 57.0*x + 120.0*y + 26.0*x*y*t + 48.0*y*z*z + 50.0*y*z*t + 42.0*x*t + 14.0*x*z*z + 24.0*x*y*z + 96.0*y*t + 28.0*z*z*t + 29.0*z*t*t + 30.0*t*t*t + 7.0*x*x*t + 69.0*y*y*t + 138.0*y*y + 10.0*x*x*y + 37.0*x*x + 49.0*z*z + 50.0*z*t + 66.0*y*y*z + 80.0*x*y + 27.0*z*z*z + 41.0*x*z + 33.0*x*y*y + 84.0*y*y*y + 52.0*y*t*t + 16.0*x*t*t + 6.0*x*x*z + 94.0*y*z + 61.0*z + 62.0*t + 2.0*x*x*x + 51.0*t*t + 67.0; end fy; function fz(x:real; y:real; z:real; t:real) return real is begin return 3.0*x*x*x + 6.0*x*x*y + 16.0*x*x*z + 9.0*x*x*t + 12.0*x*y*y + 28.0*x*y*z + 15.0*x*y*t + 51.0*x*z*z + 36.0*x*z*t + 19.0*x*t*t + 22.0*y*y*y + 48.0*y*y*z + 25.0*y*y*t + 81.0*y*z*z + 56.0*y*z*t + 29.0*y*t*t + 124.0*z*z*z + 96.0*z*z*t + 66.0*z*t*t + 34.0*t*t*t + 38.0*x*x + 41.0*x*y + 86.0*x*z + 44.0*x*t + 47.0*y*y + 98.0*y*z + 50.0*y*t + 156.0*z*z + 106.0*z*t + 54.0*t*t + 58.0*x + 61.0*y + 126.0*z + 64.0*t + 68.0; end fz; function ft(x:real; y:real; z:real; t:real) return real is begin return 4.0*x*x*x + 7.0*x*x*y + 9.0*x*x*z + 20.0*x*x*t + 13.0*x*y*y + 15.0*x*y*z + 32.0*x*y*t + 18.0*x*z*z + 38.0*x*z*t + 60.0*x*t*t + 23.0*y*y*y + 25.0*y*y*z + 52.0*y*y*t + 28.0*y*z*z + 58.0*y*z*t + 90.0*y*t*t + 32.0*z*z*z + 66.0*z*z*t +102.0*z*t*t +140.0*t*t*t + 39.0*x*x + 42.0*x*y + 44.0*x*z + 90.0*x*t + 48.0*y*y + 50.0*y*z +102.0*y*t + 53.0*z*z +108.0*z*t +165.0*t*t + 59.0*x + 62.0*y + 64.0*z + 130.0*t + 69.0; end ft; function fxx(x:real; y:real; z:real; t:real) return real is begin return 18.0*z*t+112.0+14.0*y*t+78.0*t+16.0*z*z+12.0*y*z+24.0*x*t+ 12.0*x*y+216.0*x+74.0*y+76.0*z+10.0*y*y+20.0*t*t+18.0*x*z+ 12.0*x*x; end fxx; function fxy(x:real; y:real; z:real; t:real) return real is begin return 57.0+14.0*x*t+14.0*z*z+15.0*z*t+12.0*x*z+42.0*t+26.0*y*t+ 80.0*y+6.0*x*x+24.0*y*z+74.0*x+20.0*x*y+33.0*y*y+ 16.0*t*t+41.0*z; end fxy; function fxz(x:real; y:real; z:real; t:real) return real is begin return 18.0*x*t+28.0*y*z+15.0*y*t+32.0*x*z+12.0*x*y+36.0*z*t+ 19.0*t*t+86.0*z+44.0*t+12.0*y*y+51.0*z*z+76.0*x+9.0*x*x+ 41.0*y+58.0; end fxz; function fxt(x:real; y:real; z:real; t:real) return real is begin return 18.0*x*z+14.0*x*y+15.0*y*z+78.0*x+42.0*y+18.0*z*z+38.0*z*t+ 60.0*t*t+12.0*x*x+13.0*y*y+44.0*z+32.0*y*t+40.0*x*t+ 59.0+90.0*t; end fxt; function fyy(x:real; y:real; z:real; t:real) return real is begin return 120.0+26.0*x*t+48.0*z*z+50.0*z*t+24.0*x*z+96.0*t+138.0*y*t+ 276.0*y+10.0*x*x+132.0*y*z+80.0*x+66.0*x*y+252.0*y*y+ 52.0*t*t+94.0*z; end fyy; function fyz(x:real; y:real; z:real; t:real) return real is begin return 15.0*x*t+96.0*y*z+50.0*y*t+28.0*x*z+24.0*x*y+56.0*z*t+ 29.0*t*t+98.0*z+50.0*t+66.0*y*y+81.0*z*z+41.0*x+6.0*x*x+ 94.0*y+61.0; end fyz; function fyt(x:real; y:real; z:real; t:real) return real is begin return 15.0*x*z+26.0*x*y+50.0*y*z+42.0*x+96.0*y+28.0*z*z+ 58.0*z*t+90.0*t*t+7.0*x*x+69.0*y*y+50.0*z+104.0*y*t+ 32.0*x*t+62.0+102.0*t; end fyt; function fzz(x:real; y:real; z:real; t:real) return real is begin return 36.0*x*t+162.0*y*z+56.0*y*t+102.0*x*z+28.0*x*y+192.0*z*t+66.0*t*t+ 312.0*z+106.0*t+48.0*y*y+372.0*z*z+86.0*x+16.0*x*x+98.0*y+126.0; end fzz; function fzt(x:real; y:real; z:real; t:real) return real is begin return 36.0*x*z+15.0*x*y+56.0*y*z+44.0*x+50.0*y+96.0*z*z+ 132.0*z*t+102.0*t*t+9.0*x*x+25.0*y*y+106.0*z+58.0*y*t+ 38.0*x*t+64.0+108.0*t; end fzt; function ftt(x:real; y:real; z:real; t:real) return real is begin return 38.0*x*z+32.0*x*y+58.0*y*z+90.0*x+102.0*y+66.0*z*z+204.0*z*t+ 420.0*t*t+20.0*x*x+52.0*y*y+108.0*z+180.0*y*t+120.0*x*t+ 130.0+330.0*t; end ftt; function fxxx(x:real; y:real; z:real; t:real) return real is begin return 24.0*t+24.0*x+12.0*y+18.0*z+216.0; end fxxx; function fxxy(x:real; y:real; z:real; t:real) return real is begin return 14.0*t+12.0*z+20.0*y+12.0*x+74.0; end fxxy; function fxxz(x:real; y:real; z:real; t:real) return real is begin return 18.0*t+12.0*y+32.0*z+18.0*x+76.0; end fxxz; function fxxt(x:real; y:real; z:real; t:real) return real is begin return 14.0*y+18.0*z+24.0*x+40.0*t+78.0; end fxxt; function fxyy(x:real; y:real; z:real; t:real) return real is begin return 26.0*t+24.0*z+20.0*x+80.0+66.0*y ; end fxyy; function fxyz(x:real; y:real; z:real; t:real) return real is begin return 28.0*z+15.0*t+12.0*x+24.0*y+41.0; end fxyz; function fxyt(x:real; y:real; z:real; t:real) return real is begin return 14.0*x+15.0*z+42.0+26.0*y+32.0*t; end fxyt; function fxzz(x:real; y:real; z:real; t:real) return real is begin return 36.0*t+102.0*z+28.0*y+86.0+32.0*x; end fxzz; function fxzt(x:real; y:real; z:real; t:real) return real is begin return 18.0*x+15.0*y+36.0*z+38.0*t+44.0; end fxzt; function fxtt(x:real; y:real; z:real; t:real) return real is begin return 38.0*z+32.0*y+90.0+40.0*x+120.0*t; end fxtt; function fyyy(x:real; y:real; z:real; t:real) return real is begin return 66.0*x+132.0*z+138.0*t+504.0*y+276.0; end fyyy; function fyyz(x:real; y:real; z:real; t:real) return real is begin return 50.0*t+24.0*x+132.0*y+96.0*z+94.0; end fyyz; function fyyt(x:real; y:real; z:real; t:real) return real is begin return 26.0*x+50.0*z+138.0*y+104.0*t+96.0; end fyyt; function fyzz(x:real; y:real; z:real; t:real) return real is begin return 162.0*z+56.0*t+28.0*x+96.0*y+98.0; end fyzz; function fyzt(x:real; y:real; z:real; t:real) return real is begin return 15.0*x+50.0*y+56.0*z+58.0*t+50.0; end fyzt; function fytt(x:real; y:real; z:real; t:real) return real is begin return 32.0*x+58.0*z+102.0+104.0*y+180.0*t; end fytt; function fzzz(x:real; y:real; z:real; t:real) return real is begin return 102.0*x+162.0*y+192.0*t+744.0*z+312.0; end fzzz; function fzzt(x:real; y:real; z:real; t:real) return real is begin return 56.0*y+36.0*x+132.0*t+192.0*z+106.0; end fzzt; function fztt(x:real; y:real; z:real; t:real) return real is begin return 38.0*x+58.0*y+132.0*z+204.0*t+108.0; end fztt; function fttt(x:real; y:real; z:real; t:real) return real is begin return 204.0*z+840.0*t+180.0*y+120.0*x+330.0; end fttt; function fxxxx(x:real; y:real; z:real; t:real) return real is begin return 24.0; end fxxxx; function fxxxy(x:real; y:real; z:real; t:real) return real is begin return 12.0; end fxxxy; function fxxxz(x:real; y:real; z:real; t:real) return real is begin return 18.0; end fxxxz; function fxxxt(x:real; y:real; z:real; t:real) return real is begin return 24.0; end fxxxt; function fxxyy(x:real; y:real; z:real; t:real) return real is begin return 20.0; end fxxyy; function fxxyz(x:real; y:real; z:real; t:real) return real is begin return 12.0; end fxxyz; function fxxyt(x:real; y:real; z:real; t:real) return real is begin return 14.0; end fxxyt; function fxxzz(x:real; y:real; z:real; t:real) return real is begin return 32.0; end fxxzz; function fxxzt(x:real; y:real; z:real; t:real) return real is begin return 18.0; end fxxzt; function fxxtt(x:real; y:real; z:real; t:real) return real is begin return 40.0; end fxxtt; function fxyyy(x:real; y:real; z:real; t:real) return real is begin return 66.0; end fxyyy; function fxyyz(x:real; y:real; z:real; t:real) return real is begin return 24.0; end fxyyz; function fxyyt(x:real; y:real; z:real; t:real) return real is begin return 26.0; end fxyyt; function fxyzz(x:real; y:real; z:real; t:real) return real is begin return 28.0; end fxyzz; function fxyzt(x:real; y:real; z:real; t:real) return real is begin return 15.0; end fxyzt; function fxytt(x:real; y:real; z:real; t:real) return real is begin return 32.0; end fxytt; function fxzzz(x:real; y:real; z:real; t:real) return real is begin return 102.0; end fxzzz; function fxzzt(x:real; y:real; z:real; t:real) return real is begin return 36.0; end fxzzt; function fxztt(x:real; y:real; z:real; t:real) return real is begin return 38.0; end fxztt; function fxttt(x:real; y:real; z:real; t:real) return real is begin return 120.0; end fxttt; function fyyyy(x:real; y:real; z:real; t:real) return real is begin return 504.0; end fyyyy; function fyyyz(x:real; y:real; z:real; t:real) return real is begin return 132.0; end fyyyz; function fyyyt(x:real; y:real; z:real; t:real) return real is begin return 138.0; end fyyyt; function fyyzz(x:real; y:real; z:real; t:real) return real is begin return 96.0; end fyyzz; function fyyzt(x:real; y:real; z:real; t:real) return real is begin return 50.0; end fyyzt; function fyytt(x:real; y:real; z:real; t:real) return real is begin return 104.0; end fyytt; function fyzzz(x:real; y:real; z:real; t:real) return real is begin return 162.0; end fyzzz; function fyzzt(x:real; y:real; z:real; t:real) return real is begin return 56.0; end fyzzt; function fyztt(x:real; y:real; z:real; t:real) return real is begin return 58.0; end fyztt; function fyttt(x:real; y:real; z:real; t:real) return real is begin return 180.0; end fyttt; function fzzzz(x:real; y:real; z:real; t:real) return real is begin return 744.0; end fzzzz; function fzzzt(x:real; y:real; z:real; t:real) return real is begin return 192.0; end fzzzt; function fzztt(x:real; y:real; z:real; t:real) return real is begin return 132.0; end fzztt; function fzttt(x:real; y:real; z:real; t:real) return real is begin return 204.0; end fzttt; function ftttt(x:real; y:real; z:real; t:real) return real is begin return 840.0; end ftttt; procedure gen_data4(which : Integer) is rx : real := 0.25; ry : real := 0.28; rz : real := 0.33; rt : real := 0.37; drx : real := 0.0096; dry : real := 0.0094; drz : real := 0.0091; drt : real := 0.0089; thx : real := 0.2; thy : real := 1.7; thz : real := 2.3; tht : real := 3.32; dthx : real := 0.61; dthy : real := 0.72; dthz : real := 0.49; dtht : real := 0.53; d5th : real := 0.628318531; d3rd : real := 1.047197551; th5th : real := 1.256637061; r : real := 0.2; theta1 : real := 0.05; phi1 : real := 0.1; psi1 : real := 0.15; nn : integer := 0; theta, phi, psi : real ; begin if which=0 then for i in 0..n loop x(i) := rx*sin(thx); y(i) := ry*cos(thy); z(i) := rz*sin(thz); t(i) := rt*cos(tht); rx := rx + drx; ry := ry + dry; rz := rz + drz; rt := rt + drt; thx := thx + dthx; thy := thy + dthy; thz := thz + dthz; tht := tht + dtht; end loop; else nn := 0; psi := psi1; for ipsi in 0..2 loop phi := phi1; for iphi in 0..4 loop theta := theta1; for itheta in 0..4 loop x(nn) := r*sin(psi)*sin(phi)*cos(theta); y(nn) := r*sin(psi)*sin(phi)*sin(theta); z(nn) := r*sin(psi)*cos(phi); t(nn) := r*cos(psi); nn := nn +1; if nn=n then return; end if; r := r + 0.011; theta := theta + th5th; end loop; theta1 := theta1 + 0.008; phi := phi + d5th; end loop; phi1 := phi1 + 0.009; psi := psi + d3rd; end loop; end if; end Gen_Data4; begin Put_line("test_nuderiv4d.adb running"); Gen_Data4(1); for I in 0..n loop U(i) := f(x(i),y(i),z(i),t(i)); dx := fx(x(i),y(i),z(i),t(i)); put_line("point "&integer'image(i)&" x:="&real'image(x(i))); put_line("U:="&real'image(U(i))&", dx:="&real'image(dx)); end loop; maxerror := 0.0; for point in 0..n loop -- Ux nu4dx(order, n, point, x, y, z, t, cx); est := 0.0; for I in 0..N loop est := est + cx(i)*U(i); end loop; actual := fx(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cx "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Ux for point in 0..n loop -- Uy nu4dy(order, n, point, x, y, z, t, cy); est := 0.0; for I in 0..N loop est := est + cy(i)*U(i); end loop; actual := fy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uy for point in 0..n loop -- Uz nu4dz(order, n, point, x, y, z, t, cz); est := 0.0; for I in 0..N loop est := est + cz(i)*U(i); end loop; actual := fz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uz for point in 0..n loop -- Ut nu4dt(order, n, point, x, y, z, t, ct); est := 0.0; for I in 0..N loop est := est + ct(i)*U(i); end loop; actual := ft(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("ct "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Ut for point in 0..n loop -- Uxx nu4dxx(order, n, point, x, y, z, t, cxx); est := 0.0; for I in 0..N loop est := est + cxx(i)*U(i); end loop; actual := fxx(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxx "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxx for point in 0..n loop -- Uxy nu4dxy(order, n, point, x, y, z, t, cxy); est := 0.0; for I in 0..N loop est := est + cxy(i)*U(i); end loop; actual := fxy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxy for point in 0..n loop -- Uxz nu4dxz(order, n, point, x, y, z, t, cxz); est := 0.0; for I in 0..N loop est := est + cxz(i)*U(i); end loop; actual := fxz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxz for point in 0..n loop -- Uxt nu4dxt(order, n, point, x, y, z, t, cxt); est := 0.0; for I in 0..N loop est := est + cxt(i)*U(i); end loop; actual := fxt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxt for point in 0..n loop -- Uyy nu4dyy(order, n, point, x, y, z, t, cyy); est := 0.0; for I in 0..N loop est := est + cyy(i)*U(i); end loop; actual := fyy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyy for point in 0..n loop -- Uyy nu4dyz(order, n, point, x, y, z, t, cyz); est := 0.0; for I in 0..N loop est := est + cyz(i)*U(i); end loop; actual := fyz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyz for point in 0..n loop -- Uyt nu4dyt(order, n, point, x, y, z, t, cyt); est := 0.0; for I in 0..N loop est := est + cyt(i)*U(i); end loop; actual := fyt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyt for point in 0..n loop -- Uzz nu4dzz(order, n, point, x, y, z, t, czz); est := 0.0; for I in 0..N loop est := est + czz(i)*U(i); end loop; actual := fzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("czz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uzz for point in 0..n loop -- Uzt nu4dzt(order, n, point, x, y, z, t, czt); est := 0.0; for I in 0..N loop est := est + czt(i)*U(i); end loop; actual := fzt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("czt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uzt for point in 0..n loop -- Utt nu4dtt(order, n, point, x, y, z, t, ctt); est := 0.0; for I in 0..N loop est := est + ctt(i)*U(i); end loop; actual := ftt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("ctt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Utt for point in 0..n loop -- Uxxx nu4dxxx(order, n, point, x, y, z, t, cxxx); est := 0.0; for I in 0..N loop est := est + cxxx(i)*U(i); end loop; actual := fxxx(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxx "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxx for point in 0..n loop -- Uxxy nu4dxxy(order, n, point, x, y, z, t, cxxy); est := 0.0; for I in 0..N loop est := est + cxxy(i)*U(i); end loop; actual := fxxy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxy for point in 0..n loop -- Uxxz nu4dxxz(order, n, point, x, y, z, t, cxxz); est := 0.0; for I in 0..N loop est := est + cxxz(i)*U(i); end loop; actual := fxxz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxz for point in 0..n loop -- Uxxt nu4dxxt(order, n, point, x, y, z, t, cxxt); est := 0.0; for I in 0..N loop est := est + cxxt(i)*U(i); end loop; actual := fxxt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxt for point in 0..n loop -- Uxyy nu4dxyy(order, n, point, x, y, z, t, cxyy); est := 0.0; for I in 0..N loop est := est + cxyy(i)*U(i); end loop; actual := fxyy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxyy for point in 0..n loop -- Uxyz nu4dxyz(order, n, point, x, y, z, t, cxyz); est := 0.0; for I in 0..N loop est := est + cxyz(i)*U(i); end loop; actual := fxyz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxyz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxyz for point in 0..n loop -- Uxyt nu4dxyt(order, n, point, x, y, z, t, cxyt); est := 0.0; for I in 0..N loop est := est + cxyt(i)*U(i); end loop; actual := fxyt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxyz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxyt for point in 0..n loop -- Uxzz nu4dxzz(order, n, point, x, y, z, t, cxzz); est := 0.0; for I in 0..N loop est := est + cxzz(i)*U(i); end loop; actual := fxzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxzz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxzz for point in 0..n loop -- Uxzt nu4dxzt(order, n, point, x, y, z, t, cxzt); est := 0.0; for I in 0..N loop est := est + cxzt(i)*U(i); end loop; actual := fxzt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxzt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxzt for point in 0..n loop -- Uxtt nu4dxtt(order, n, point, x, y, z, t, cxtt); est := 0.0; for I in 0..N loop est := est + cxtt(i)*U(i); end loop; actual := fxtt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxtt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxtt for point in 0..n loop -- Uyyy nu4dyyy(order, n, point, x, y, z, t, cyyy); est := 0.0; for I in 0..N loop est := est + cyyy(i)*U(i); end loop; actual := fyyy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyyy for point in 0..n loop -- Uyyz nu4dyyz(order, n, point, x, y, z, t, cyyz); est := 0.0; for I in 0..N loop est := est + cyyz(i)*U(i); end loop; actual := fyyz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyyz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyyz for point in 0..n loop -- Uyyt nu4dyyt(order, n, point, x, y, z, t, cyyt); est := 0.0; for I in 0..N loop est := est + cyyt(i)*U(i); end loop; actual := fyyt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyyt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyyt for point in 0..n loop -- Uyzz nu4dyzz(order, n, point, x, y, z, t, cyzz); est := 0.0; for I in 0..N loop est := est + cyzz(i)*U(i); end loop; actual := fyzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyzz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyzz for point in 0..n loop -- Uyzt nu4dyzt(order, n, point, x, y, z, t, cyzt); est := 0.0; for I in 0..N loop est := est + cyzt(i)*U(i); end loop; actual := fyzt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyzt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyzt for point in 0..n loop -- Uytt nu4dytt(order, n, point, x, y, z, t, cytt); est := 0.0; for I in 0..N loop est := est + cytt(i)*U(i); end loop; actual := fytt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uytt for point in 0..n loop -- Uzzz nu4dzzz(order, n, point, x, y, z, t, czzz); est := 0.0; for I in 0..N loop est := est + czzz(i)*U(i); end loop; actual := fzzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("czzz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uzzz for point in 0..n loop -- Uzzt nu4dzzt(order, n, point, x, y, z, t, czzt); est := 0.0; for I in 0..N loop est := est + czzt(i)*U(i); end loop; actual := fzzt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("czzt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uzzt for point in 0..n loop -- Uztt nu4dztt(order, n, point, x, y, z, t, cztt); est := 0.0; for I in 0..N loop est := est + cztt(i)*U(i); end loop; actual := fztt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cztt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uztt for point in 0..n loop -- Uttt nu4dttt(order, n, point, x, y, z, t, cttt); est := 0.0; for I in 0..N loop est := est + cttt(i)*U(i); end loop; actual := fttt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cttt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uttt for point in 0..n loop -- Uxxxx nu4dxxxx(order, n, point, x, y, z, t, cxxxx); est := 0.0; for I in 0..N loop est := est + cxxxx(i)*U(i); end loop; actual := fxxxx(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxxx "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxxx for point in 0..n loop -- Uxxxy nu4dxxxy(order, n, point, x, y, z, t, cxxxy); est := 0.0; for I in 0..N loop est := est + cxxxy(i)*U(i); end loop; actual := fxxxy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxxy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxxy for point in 0..n loop -- Uxxxz nu4dxxxz(order, n, point, x, y, z, t, cxxxz); est := 0.0; for I in 0..N loop est := est + cxxxz(i)*U(i); end loop; actual := fxxxz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxxz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxxz for point in 0..n loop -- Uxxxt nu4dxxxt(order, n, point, x, y, z, t, cxxxt); est := 0.0; for I in 0..N loop est := est + cxxxt(i)*U(i); end loop; actual := fxxxt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxxt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxxt for point in 0..n loop -- Uxxyy nu4dxxyy(order, n, point, x, y, z, t, cxxyy); est := 0.0; for I in 0..N loop est := est + cxxyy(i)*U(i); end loop; actual := fxxyy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxyy for point in 0..n loop -- Uxxyz nu4dxxyz(order, n, point, x, y, z, t, cxxyz); est := 0.0; for I in 0..N loop est := est + cxxyz(i)*U(i); end loop; actual := fxxyz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxyz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxyz for point in 0..n loop -- Uxxyt nu4dxxyt(order, n, point, x, y, z, t, cxxyt); est := 0.0; for I in 0..N loop est := est + cxxyt(i)*U(i); end loop; actual := fxxyt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxyt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxyt for point in 0..n loop -- Uxxzz nu4dxxzz(order, n, point, x, y, z, t, cxxzz); est := 0.0; for I in 0..N loop est := est + cxxzz(i)*U(i); end loop; actual := fxxzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxzz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxzz for point in 0..n loop -- Uxxzt nu4dxxzt(order, n, point, x, y, z, t, cxxzt); est := 0.0; for I in 0..N loop est := est + cxxzt(i)*U(i); end loop; actual := fxxzt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxzt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxzt for point in 0..n loop -- Uxxtt nu4dxxtt(order, n, point, x, y, z, t, cxxtt); est := 0.0; for I in 0..N loop est := est + cxxtt(i)*U(i); end loop; actual := fxxtt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cxxtt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uxxtt for point in 0..n loop -- Uyyyy nu4dyyyy(order, n, point, x, y, z, t, cyyyy); est := 0.0; for I in 0..N loop est := est + cyyyy(i)*U(i); end loop; actual := fyyyy(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("cyyyy "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uyyyy for point in 0..n loop -- Uzzzz nu4dzzzz(order, n, point, x, y, z, t, czzzz); est := 0.0; for I in 0..N loop est := est + czzzz(i)*U(i); end loop; actual := fzzzz(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("czzzz "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Uzzzz for point in 0..n loop -- Utttt nu4dtttt(order, n, point, x, y, z, t, ctttt); est := 0.0; for I in 0..N loop est := est + ctttt(i)*U(i); end loop; actual := ftttt(x(point),y(point),z(point),t(point)); error := actual-est; maxerror := max(maxerror,abs(error)); put_line("ctttt "&integer'image(point)&", est:="&real'image(est)& ", actual:="&real'image(actual)& ", error:="&real'image(Error)); end loop; -- end Utttt put_line("maxerror for order:="&integer'image(Order)& ", n:="&Integer'Image(N)& ", is "&Real'Image(maxerror)); put_line("note that relative error is 3 significant digits better"); put_line("test_nuderiv4d.adb finished"); end Test_Nuderiv4d;