identificationdivision. program-id. simpson. * aus Wirth, systematisches Programmieren p. 95 author. "JD". date-written. 11.9.2005. date-compiled. datadivision. working-storagesection. 78 eps pic9(4)V9(4) compvalue0.0001. 77 i pic9(4) comp. 77 n pic9(4) comp. 77 s pic9(4)V9(4) comp. 77 ss pic9(4)V9(4) comp. 77 diff pic9(4)V9(4) comp. 77 s1 pic9(4)V9(4) comp. 77 s2 pic9(4)V9(4) comp. 77 s4 pic9(4)V9(4) comp. 77 h pic9(4)V9(4) comp. 77 temp1 pic9(4)V9(4) comp. linkagesection. 77 a pic9(4)V9(4). 77 b pic9(4)V9(4). 77 r pic9(4)V9(4). proceduredivisionusing a b r. * computes Integral f(x) in [a,b] move2to n compute h = (b - a) * 0.5 compute s1 = h * (function f(a) + function f(b)) move0to s2 compute temp1 = a + h compute s4 = 4 * h * function f(temp1) add s1 s2 s4 giving s subtract ss from s giving diff performuntilfunction abs(diff) < eps * function abs(s) move s to ss multiply2by n divide2into h multiply0.5by s1 compute s2 = 0.5 * s2 + 0.25 * s4 move0to s4 move1to i performuntil i > n compute temp1 = a + i * h compute s4 = s4 +function f(temp1) add2to i end-perform compute s4 = 4 * h * s4 compute s = s1 + s2 + s4 end-perform compute r = s / 3. * now s = s / 3 end-program simpson.
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.