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

→‎{{header|COBOL}}: Make abs-delta unsigned so we don't have to explicitely test the sign of delta
(→‎{{header|COBOL}}: Restore blurb accidently deleted)
(→‎{{header|COBOL}}: Make abs-delta unsigned so we don't have to explicitely test the sign of delta)
Line 727:
01 ruleval1 picture s9(5)V9(20).
01 delta picture s9(5)V9(20).
01 abs-delta picture s99(5)V9(20). *> unsigned.
01 tol0 picture s9(5)V9(20).
01 tol1 picture s9(5)V9(20).
Line 751:
perform simpson-rule-thrice
compute delta = ruleval0 + ruleval1 - ruleval
ifcompute abs-delta <= 0 thendelta
compute abs-delta = -delta
else
compute abs-delta = delta
end-if
compute tol0 = tol * (x4 - x0)
compute tol1 = tol * (x2 - x0)
3,022

edits