Numerical integration/Adaptive Simpson's method: Difference between revisions
Content added Content deleted
(→{{header|ATS}}: There was needless recomputation of f. That is fixed now. Also more passing around of f than was necessary; also fixed.) |
(The pseudocode was misleading people into recomputing values already computed.) |
||
Line 15: | Line 15: | ||
fm := f(m) |
fm := f(m) |
||
h := b - a |
h := b - a |
||
'''return multiple''' [m, fm, (h / 6) * ( |
'''return multiple''' [m, fm, (h / 6) * (fa + 4*fm + fb)] |
||
'''procedure''' _quad_asr(f, a, fa, b, fb, tol, whole, m, fm, depth) |
'''procedure''' _quad_asr(f, a, fa, b, fb, tol, whole, m, fm, depth) |