⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qromb.dem

📁 Delphi Pascal 数据挖掘领域算法包 数值算法大全
💻 DEM
字号:
PROGRAM d4r4(input,output);
(* driver for routine QROMB *)
CONST
   pio2=1.5707963;
   n=5;
TYPE
   glnarray = ARRAY [1..n] OF real;
VAR
   glit : integer;
   a,b,s : real;

FUNCTION func(x: real): real;
(* Test function *)
BEGIN
   func := sqr(x)*(sqr(x)-2.0)*sin(x)
END;

FUNCTION fint(x: real): real;
(* Integral of test function func *)
BEGIN
   fint := 4.0*x*(sqr(x)-7.0)*sin(x)
      -(sqr(sqr(x))-14.0*sqr(x)+28.0)*cos(x)
END;

(*$I MODFILE.PAS *)
(*$I TRAPZD.PAS *)

(*$I POLINT.PAS *)

(*$I QROMB.PAS *)

BEGIN
   a := 0.0;
   b := pio2;
   writeln ('Integral of func computed with QROMB');
   writeln;
   writeln ('Actual value of integral is',fint(b)-fint(a):12:6);
   qromb(a,b,s);
   writeln ('Result from routine QROMB is',s:12:6);
END.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -