diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-21 10:30:55 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-21 10:30:55 +0200 |
commit | 197e88c3b56d28840217010a2871c6ea3a4dd1a4 (patch) | |
tree | 825be9d6c9d87d23f7e5497c0133d11d52c63535 /examples/deriv.hs | |
parent | e07c3dee7235496b71a89233106d93f6cc94ada1 (diff) |
update dependencies, move examples etc
Diffstat (limited to 'examples/deriv.hs')
-rw-r--r-- | examples/deriv.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/deriv.hs b/examples/deriv.hs new file mode 100644 index 0000000..c9456d1 --- /dev/null +++ b/examples/deriv.hs | |||
@@ -0,0 +1,8 @@ | |||
1 | -- Numerical differentiation | ||
2 | |||
3 | import Numeric.GSL | ||
4 | |||
5 | d :: (Double -> Double) -> (Double -> Double) | ||
6 | d f x = fst $ derivCentral 0.01 f x | ||
7 | |||
8 | main = print $ d (\x-> x * d (\y-> x+y) 1) 1 | ||