verry.integrate.cumulative_simpson#
- verry.integrate.cumulative_simpson(fun, a, b, n)#
Cumulatively integrate fun using the composite Simpson’s 1/3 rule.
- Parameters:
Warning
fun must be a \(C^4\)-function on some open interval that contains a and b. Furthermore, fun must neither be a constant nor contain conditional branches (cf. Common pitfalls).
Examples
>>> from verry import FloatInterval as FI >>> from verry import function as vrf >>> s = cumulative_simpson(lambda x: x**2 + 2 * vrf.sqrt(x), FI(1), FI(2), 10) >>> print(s) [4.771236, 4.771237]