numeric-tools-0.2.0.1: Collection of numerical tools for integration, differentiation etc.

Portability portable experimental Aleksey Khudyakov None

Numeric.Tools.Integration

Description

Funtions for numerical integration. `quadRomberg` or `quadSimpson` are reasonable choices in most cases. For non-smooth function they converge poorly and `quadTrapezoid` should be used then.

For example this code intergrates exponent from 0 to 1:

````>>> ````let res = quadRomberg defQuad (0, 1) exp
``````
````>>> ````quadRes res     -- Integration result
```Just 1.718281828459045
```
````>>> ````quadPrecEst res -- Estimate of precision
```2.5844957590474064e-16
```
````>>> ````quadNIter res   -- Number of iterations performed
```6
```

Synopsis

# Integration parameters and results

Integration parameters for numerical routines. Note that each additional iteration doubles number of function evaluation required to compute integral.

Number of iterations is capped at 30.

Constructors

Instances

Default parameters for integration functions

• Maximum number of iterations = 20
• Precision is 10⁻⁹

Result of numeric integration.

Constructors

Instances

# Integration functions

Arguments

 :: QuadParam Parameters -> (Double, Double) Integration limits -> (Double -> Double) Function to integrate -> QuadRes

Integration of using trapezoids. This is robust algorithm and place and useful for not very smooth. But it is very slow. It hundreds times slower then `quadRomberg` if function is sufficiently smooth.

Arguments

 :: QuadParam Parameters -> (Double, Double) Integration limits -> (Double -> Double) Function to integrate -> QuadRes

Integration using Simpson rule. It should be more efficient than `quadTrapezoid` if function being integrated have finite fourth derivative.

Arguments

 :: QuadParam Parameters -> (Double, Double) Integration limits -> (Double -> Double) Function to integrate -> QuadRes

Integration using Romberg rule. For sufficiently smooth functions (e.g. analytic) it's a fastest of three.