diff package:ad

The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the first derivative of a function (a -> a)
Compute the first derivative of a function (a -> a)
The diff' function calculates the result and first derivative of scalar-to-scalar function by Forward mode AD
diff' sin == sin &&& cos
diff' f = f &&& d f
>>> diff' sin 0
(0.0,1.0)
>>> diff' exp 0
(1.0,1.0)
The diffF function calculates the first derivatives of scalar-to-nonscalar function by Forward mode AD
>>> diffF (\a -> [sin a, cos a]) 0
[1.0,-0.0]
The diffF' function calculates the result and first derivatives of a scalar-to-non-scalar function by Forward mode AD
>>> diffF' (\a -> [sin a, cos a]) 0
[(0.0,1.0),(1.0,-0.0)]
The diff' function calculates the result and first derivative of scalar-to-scalar function by Forward mode AD
diff' sin == sin &&& cos
diff' f = f &&& d f
>>> diff' sin 0
(0.0,1.0)
>>> diff' exp 0
(1.0,1.0)
The diffF function calculates the first derivatives of scalar-to-nonscalar function by Forward mode AD
>>> diffF (\a -> [sin a, cos a]) 0
[1.0,-0.0]
The diffF' function calculates the result and first derivatives of a scalar-to-non-scalar function by Forward mode AD
>>> diffF' (\a -> [sin a, cos a]) 0
[(0.0,1.0),(1.0,-0.0)]