Jump to content

Numerical integration/Adaptive Simpson's method: Difference between revisions

→‎{{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
1,448

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.