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

Reordered the text and said you can use the pseudocode (which I myself did for the ATS example).
(Added instructions on what to do for the task. I simply ask people to do what existing examples do.)
(Reordered the text and said you can use the pseudocode (which I myself did for the ATS example).)
Line 1:
{{draft task|Arithmetic operations}}
Lyness's (1969) Modified [[wp:Adaptive_Simpson's_method|Adaptive Simpson's method]] ([https://doi.org/10.1145/321526.321537 doi:10.1145/321526.321537]) is a numerical quadrature method that recursively bisects the interval until the precision is high enough.
 
Write an implementation of quadrature by adaptive Simpson’s method. Use the implementation to estimate the definite integral of sin(x) from 0 to 1. Show your output.
 
You can use the following pseudocode, which includes Lyness's modifications 1, 2, and 3.
 
{| class="mw-collapsible"
Line 31 ⟶ 35:
'''return''' _quad_asr(f, a, fa, b, fb, tol, whole, m, fm, depth)
|}
 
Write an implementation of quadrature by adaptive Simpson’s method. Use the implementation to estimate the definite integral of sin(x) from 0 to 1. Show your output.
 
=={{header|11l}}==
1,448

edits