Safe Haskell | None |
---|---|
Language | Haskell98 |
- integrate :: (Integrable r, CurryBounds (Bounds r)) => r -> Curried (Bounds r) Res
Documentation
integrate :: (Integrable r, CurryBounds (Bounds r)) => r -> Curried (Bounds r) Res Source
Integrate a function of n variables by giving the corresponding n integration domains, i.e.
let f x y z = x^2 + log (y-z) integrate f (0,1) (3,4) (1,2)
This code was borrowed from the excellent answer at http://stackoverflow.com/questions/23703360/using-numeric-integration-tanhsinh-for-n-dimensional-integration.
The integration uses the Tanh-Sinh quadrature method and relies on Kmett's integration libary.