Numerical integration/Adaptive Simpson's method: Difference between revisions
Numerical integration/Adaptive Simpson's method (view source)
Revision as of 12:50, 19 May 2023
, 1 year ago→{{header|COBOL}}: Bug fix in the use of delta.
m (→{{header|COBOL}}: Fix spelling of GnuCOBOL) |
(→{{header|COBOL}}: Bug fix in the use of delta.) |
||
Line 566:
01 ruleval1 picture 9(5)V9(20).
01 delta picture 9(5)V9(20).
01 abs-delta picture 9(5)V9(20).
01 tol0 picture 9(5)V9(20).
01 tol1 picture 9(5)V9(20).
Line 590 ⟶ 591:
compute delta = ruleval0 + ruleval1 - ruleval
if delta < 0 then
compute abs-delta = -delta
else
compute abs-delta = delta
end-if
compute tol0 = tol * (x4 - x0)
compute tol1 = tol * (x2 - x0)
if (tol1 = tol0) or (abs-delta <= tol0) then
compute delta15 = delta / 15
compute stepval = ruleval0 + ruleval1 + delta15
|