Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Compute definite integrals.
Synopsis
- integrateMidpoint :: Fractional a => (a -> a) -> a -> a -> Int -> a
- integrateSimpson13 :: Fractional a => (a -> a) -> a -> a -> Int -> a
Documentation
:: Fractional a | |
=> (a -> a) | \(f\) |
-> a | \(a\) |
-> a | \(b\) |
-> Int | Number of interval subdivisions |
-> a | \(\int_a^b\mathrm dt\, f(t)\) |
Numerical integration with the midpoint method. This is one of the simplest integration algorithms.
:: Fractional a | |
=> (a -> a) | \(f\) |
-> a | \(a\) |
-> a | \(b\) |
-> Int | Number of interval subdivisions |
-> a | \(\int_a^b\mathrm dt\, f(t)\) |
Numerical integration with Simpson’s ⅓ rule, which approximates curves with quadratic polynomials. It’s not that complicated but still does very well on not-so-crazy functions.
https://en.wikipedia.org/wiki/Simpson%27s_rule
Useful as a parameter to recurseUntilPrecision
.