AutoDiff
AutoDiff copied to clipboard
nesting
*AutoDiff> let shouldBeOne = d (\x -> d (x*) 1) 1
*AutoDiff> shouldBeOne
0
Will look into
Here is how the ad
package handles it. And yes, the auto
does sort of break the fourth wall of the implementation.
$ cabal install ad
$ ghci
Prelude> :m + Numeric.AD
Prelude Numeric.AD> let d = diff
Prelude Numeric.AD> d (\x -> d (auto x*) 1) 1
1