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

Portability portable experimental Aleksey Khudyakov None

Numeric.Tools.Differentiation

Description

Numerical differentiation. `diffRichardson` is preferred way to calculate derivative.

Synopsis

# Differentiation

data DiffRes Source

Differentiation result

Constructors

 DiffRes FieldsdiffRes :: DoubleDerivative value diffPrecision :: DoubleRough error estimate

Instances

 Eq DiffRes Data DiffRes Show DiffRes Typeable DiffRes

Arguments

 :: (Double -> Double) Function -> Double Delta -> Double Point at which evaluate differential -> DiffRes

Calculate derivative using Richaradson's deferred approach to limit. This is a preferred method for numeric differentiation since it's most precise. Function could be evaluated up to 20 times.

Initial step size should be chosen fairly big. Too small one will result reduced precision, too big one in nonsensical answer.

# Fast but imprecise

Arguments

 :: (Double -> Double) Function to differentiate -> Double Delta -> (Double, Double) Coordinate and function value at this point -> Double

Simplest form of differentiation. Should be used only when function evaluation is prohibitively expensive and already computed value at point `x` should be reused.

``` f'(x) = f(x+h) - f(x) / h
```

Arguments

 :: (Double -> Double) Function to differentiate -> Double Delta -> Double Point at which evaluate differential -> Double

Simple differentiation. It uses simmetric rule and provide reasonable accuracy. It's suitable when function evaluation is expensive and precision could be traded for speed.

``` f'(x) = f(x-h) + f(x+h) / 2h
```

# Utils

Arguments

 :: Double x -> Double small delta -> Double

For number `x` and small `h` return such `h'` that `x+h'` and `x` differ by representable number

# References

• Ridders, C.J.F. 1982, Accurate computation of F`(x) and F`(x)F``(x), Advances in Engineering Software, vol. 4, no. 2, pp. 75-76.