1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Evaluation algorithms for integrals of functions
/// Evaluate the integral of f in [a, b] with step size h using the Trapezoid rule
///
/// # Panics
/// Panics when b < a or h <= 0.
///
/// # Examples
/// ```
/// use scialg::integration::trapezoid;
///
/// let area = trapezoid(f32::sin, 0.0, std::f32::consts::PI, 0.001);
///
/// assert!((2.0 - area).abs() < 0.001);
/// ```