!qI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST U V W X Y Z [ \ ] ^ _ ` a bcdefghijklmnopqrstuvwxyz{|}~        !!!!!!!!!!!!!!!!!!""""$#(c) Edward Kmett 2010-2019BSD3ekmett@gmail.com experimentalGHC onlyNoneM#(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlySafe12>UVX*ad3Used to sidestep the need for UndecidableInstances.adA C is a tower of all (higher order) partial derivatives of a functionAt each step, a  f& is wrapped in another layer worth of f. )a :- f a :- f (f a) :- f (f (f a)) :- ...adTake the tail of a .adTake the head of a .ad Construct a  by unzipping the layers of a  Comonad.3(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone=>?@ACHMSVX1 adjallowed to return False for items with a zero derivative, but we'll give more NaNs than strictly necessary adPallowed to return False for zero, but we give more NaN's than strictly necessaryadEmbed a constantadScalar-vector multiplicationadVector-scalar multiplicationadScalar divisionad  = lift 0   777(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone8=>?@ACHMSVX5>#ad#C is useful for defining new AD primitives in a fairly generic way.#$(%&')*#$(%&')*None2HMV5+,-+,-(c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone &'2>HV8=ad>The choice between two AD modes is an AD mode in its own right =?>@ABCDEFGH =?>CBDE@AFGH(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone 12>HMUV;Xad>The composition of two AD modes is an AD mode in its own rightXYZXYZ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone 2=>?@AHMV=Ghijklmnhijklmn$(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneDadZip a  f with a  g assuming f! has at least as many entries as g.adZip a  f with a  g assuming f, using a default value after f is exhausted.ad"Used internally to define various  combinators.ad"Used internally to define various  combinators.adaUsed internally to implement functions which truncate lists after the stream of results converge (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone2=>?@AHSVXH"adTower is an AD  B that calculates a tangent tower by forward AD, and provides fast diffsUU, diffsUF6 (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone2=>?@ACHUVXadWe only store partials in sorted order, so the map contained in a partial will only contain partials with equal or greater keys to that of the map in which it was found. This should be key for efficiently computing sparse hessians. there are only  n + k - 1 choose k? distinct nth partial derivatives of a function with k inputs.ad3The value of the derivative of (f*g) of order mi is  [a *  ( ( b) f) *  ( ( c) g) | (a,b,c) <-  mi ]  It is a bit more complicated in V below, since we build the whole tree of derivatives and want to prune the tree with _s as much as possible. The number of terms in the sum for order mi as of differentiation has  ( (+1) as)X terms, so this is *much* more efficient than the naive recursive differentiation with 2^ as terms. The coefficients aX, which collect equivalent derivatives, are suitable products of binomial coefficients.6 None&'2=>?@AHSVXg adThis is used to create a new entry on the chain given a unary function, its derivative with respect to its input, the variable ID of its input, and the value of its input. Used by % and ( internally.adThis is used to create a new entry on the chain given a binary function, its derivatives with respect to its inputs, their variable IDs and values. Used by ( internally.ad^Helper that extracts the derivative of a chain when the chain was constructed with 1 variable.adnHelper that extracts both the primal and derivative of a chain when the chain was constructed with 1 variable.ad5Used internally to push sensitivities down the chain.adDExtract the partials from the current chain for a given AD variable.ad Return an  of # given bounds for the variable IDs.ad Return an  of sparse partialsad"Construct a tape that starts with n variables.(c) Edward Kmett 2012-2015BSD3ekmett@gmail.com experimentalGHC onlyNone&'2=>?@AHSVXx/ adThis is used to create a new entry on the chain given a unary function, its derivative with respect to its input, the variable ID of its input, and the value of its input. Used by % and ( internally.adThis is used to create a new entry on the chain given a binary function, its derivatives with respect to its inputs, their variable IDs and values. Used by ( internally.ad^Helper that extracts the derivative of a chain when the chain was constructed with 1 variable.adnHelper that extracts both the primal and derivative of a chain when the chain was constructed with 1 variable.ad5Used internally to push sensitivities down the chain.adDExtract the partials from the current chain for a given AD variable.ad Return an  of # given bounds for the variable IDs. ad Return an  of sparse partials ad"Construct a tape that starts with n variables.          (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone2=?@ACHSVX%adKahn is a  A using reverse-mode automatic differentiation that provides fast diffFU, diff2FU, grad, grad2 and a fast jacobianE when you have a significantly smaller number of outputs than inputs.'adA Tape\ records the information needed back propagate from the output to each input during reverse   AD.ad*back propagate sensitivities along a tape.0adhThis returns a list of contributions to the partials. The variable ids returned in the list are likely not unique!1ad Return an  of 0# given bounds for the variable IDs.2ad Return an  of sparse partials!"#$%&'+*)(,-./0123456789:;%&'+*)(,012./34!"#$78:9;-56None ,=>?@AHVL PQRSTUVWXYZ[ PQRSUTVWXYZ[(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone2=?@AHSVXGkadk mode ADoadCalculate the o using forward mode AD.kmnlopqrstuvwxkmnlsoqprtuvwx(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone2=>?@AHSVXs(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone >@ACSXadThe k function calculates the gradient of a non-scalar-to-scalar function with reverse-mode AD in a single pass. grad (\[x,y,z] -> x*y+z) [1,2,3][2,1,1]grad (\[x,y] -> x**y) [0,2] [0.0,NaN]adThe v function calculates the result and gradient of a non-scalar-to-scalar function with reverse-mode AD in a single pass.!grad' (\[x,y,z] -> x*y+z) [1,2,3] (5,[2,1,1])ad g fE function calculates the gradient of a non-scalar-to-scalar function ft with reverse-mode AD in a single pass. The gradient is combined element-wise with the argument using the function g.  ==  (_ dx -> dx)  ==   ad g fG calculates the result and gradient of a non-scalar-to-scalar function fs with reverse-mode AD in a single pass the gradient is combined element-wise with the argument using the function g.  ==  (_ dx -> dx) adThe c function calculates the jacobian of a non-scalar-to-non-scalar function with reverse AD lazily in m passes for m outputs.$jacobian (\[x,y] -> [y,x,x*y]) [2,1][[0,1],[1,0],[1,2]]adThe b function calculates both the result and the Jacobian of a nonscalar-to-nonscalar function, using m# invocations of reverse AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of  | An alias for gradF'%jacobian' (\[x,y] -> [y,x,x*y]) [2,1][(1,[0,1]),(2,[1,0]),(2,[1,2])]adR'jacobianWith g f' calculates the Jacobian of a non-scalar-to-non-scalar function f with reverse AD lazily in m passes for m outputs.kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  ==  (_ dx -> dx)   == (f x ->  x  f x) adW g f' calculates both the result and the Jacobian of a nonscalar-to-nonscalar function f, using m# invocations of reverse AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  ==  (_ dx -> dx)ad%Compute the derivative of a function. diff sin 01.0adThe Z function calculates the result and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)ad`Compute the derivatives of each result of a scalar-to-vector function with regards to its input.diffF (\a -> [sin a, cos a]) 0 [1.0,0.0]advCompute the derivatives of each result of a scalar-to-vector function with regards to its input along with the answer.diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,0.0)]adCompute the hessian via the jacobian of the gradient. gradient is computed in reverse mode and then the jacobian is computed in reverse mode.However, since the  f :: f a -> f ai is square this is not as fast as using the forward-mode Jacobian of a reverse mode gradient provided by "%.hessian (\[x,y] -> x*y) [1,2] [[0,1],[1,0]]adCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function via the reverse-mode Jacobian of the reverse-mode Jacobian of the function.Less efficient than &'.;hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2 :: RDouble]r[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.131204383757,-2.471726672005],[-2.471726672005,1.131204383757]]] (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone >@ACSXadThe k function calculates the gradient of a non-scalar-to-scalar function with reverse-mode AD in a single pass. grad (\[x,y,z] -> x*y+z) [1,2,3] [2.0,1.0,1.0]grad (\[x,y] -> x**y) [0,2] [0.0,NaN]adThe w function calculates the result and gradient of a non-scalar-to-scalar function with reverse-mode AD in a single pass.!grad' (\[x,y,z] -> x*y+z) [1,2,3](5.0,[2.0,1.0,1.0])ad g fE function calculates the gradient of a non-scalar-to-scalar function ft with reverse-mode AD in a single pass. The gradient is combined element-wise with the argument using the function g.  ==  (_ dx -> dx)  ==   ad g fG calculates the result and gradient of a non-scalar-to-scalar function fs with reverse-mode AD in a single pass the gradient is combined element-wise with the argument using the function g.  ==  (_ dx -> dx) adThe c function calculates the jacobian of a non-scalar-to-non-scalar function with reverse AD lazily in m passes for m outputs.$jacobian (\[x,y] -> [y,x,x*y]) [2,1][[0.0,1.0],[1.0,0.0],[1.0,2.0]]adThe b function calculates both the result and the Jacobian of a nonscalar-to-nonscalar function, using m# invocations of reverse AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of  | An alias for gradF'%jacobian' (\[x,y] -> [y,x,x*y]) [2,1]1[(1.0,[0.0,1.0]),(2.0,[1.0,0.0]),(2.0,[1.0,2.0])]adR'jacobianWith g f' calculates the Jacobian of a non-scalar-to-non-scalar function f with reverse AD lazily in m passes for m outputs.kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  ==  (_ dx -> dx)   == (f x ->  x  f x) adW g f' calculates both the result and the Jacobian of a nonscalar-to-nonscalar function f, using m# invocations of reverse AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  ==  (_ dx -> dx)ad%Compute the derivative of a function. diff sin 01.0adThe Z function calculates the result and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)ad`Compute the derivatives of each result of a scalar-to-vector function with regards to its input.diffF (\a -> [sin a, cos a]) 0 [1.0,0.0]advCompute the derivatives of each result of a scalar-to-vector function with regards to its input along with the answer.diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,0.0)]adCompute the hessian via the jacobian of the gradient. gradient is computed in reverse mode and then the jacobian is computed in reverse mode.However, since the  f :: f a -> f ai is square this is not as fast as using the forward-mode Jacobian of a reverse mode gradient provided by "%.hessian (\[x,y] -> x*y) [1,2][[0.0,1.0],[1.0,0.0]]adCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function via the reverse-mode Jacobian of the reverse-mode Jacobian of the function.Less efficient than &'.:hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2 :: Double][[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.1312043837568135,-2.4717266720048188],[-2.4717266720048188,1.1312043837568135]]](c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone%fadCCompute the directional derivative of a function given a zipped up * of the input values and their derivativesadNCompute the answer and directional derivative of a function given a zipped up * of the input values and their derivativesadMCompute a vector of directional derivatives for a function given a zipped up + of the input values and their derivatives.adYCompute a vector of answers and directional derivatives for a function given a zipped up + of the input values and their derivatives.adThe Y function calculates the first derivative of a scalar-to-scalar function by forward-mode AD diff sin 01.0adThe U function calculates the result and first derivative of scalar-to-scalar function by k mode AD   ==  ()   f = f () d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)adThe N function calculates the first derivatives of scalar-to-nonscalar function by k mode ADdiffF (\a -> [sin a, cos a]) 0 [1.0,-0.0]adThe \ function calculates the result and first derivatives of a scalar-to-non-scalar function by k mode ADdiffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]adBA fast, simple, transposed Jacobian computed with forward-mode AD.ad2A fast, simple, transposed Jacobian computed with k mode AD) that combines the output with the input.adCompute the Jacobian using k mode AD%. This must transpose the result, so ( is faster and allows more result types.7jacobian (\[x,y] -> [y,x,x+y,x*y,exp x * sin y]) [pi,1]_[[0.0,1.0],[1.0,0.0],[1.0,1.0],[1.0,3.141592653589793],[19.472221418841606,12.502969588876512]]adCompute the Jacobian using k mode ADK and combine the output with the input. This must transpose the result, so ) is faster, and allows more result types.adCompute the Jacobian using k mode AD along with the actual answer.adCompute the Jacobian using k mode ADW combined with the input using a user specified function, along with the actual answer.ad9Compute the gradient of a function using forward mode AD.Note, this performs O(n) worse than * for n2 inputs, in exchange for better space utilization.adDCompute the gradient and answer to a function using forward mode AD.Note, this performs O(n) worse than + for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and combine the result with the input using a user-specified function.Note, this performs O(n) worse than , for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and the answer, and combine the result with the input using a user-specified function.Note, this performs O(n) worse than - for n2 inputs, in exchange for better space utilization.gradWith' (,) sum [0..4]$(10,[(0,1),(1,1),(2,1),(3,1),(4,1)])adRCompute the product of a vector with the Hessian using forward-on-forward-mode AD.adJCompute the gradient and hessian product using forward-on-forward-mode AD.kk(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSXUadCCompute the directional derivative of a function given a zipped up * of the input values and their derivativesadNCompute the answer and directional derivative of a function given a zipped up * of the input values and their derivativesadMCompute a vector of directional derivatives for a function given a zipped up + of the input values and their derivatives.adYCompute a vector of answers and directional derivatives for a function given a zipped up + of the input values and their derivatives.adThe Y function calculates the first derivative of a scalar-to-scalar function by forward-mode + diff sin 01.0adThe U function calculates the result and first derivative of scalar-to-scalar function by k mode +   ==  ()   f = f () d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)adThe N function calculates the first derivatives of scalar-to-nonscalar function by k mode +diffF (\a -> [sin a, cos a]) 0 [1.0,-0.0]adThe \ function calculates the result and first derivatives of a scalar-to-non-scalar function by k mode +diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]adBA fast, simple, transposed Jacobian computed with forward-mode AD.ad2A fast, simple, transposed Jacobian computed with k mode +) that combines the output with the input.adCompute the Jacobian using k mode +%. This must transpose the result, so ( is faster and allows more result types.7jacobian (\[x,y] -> [y,x,x+y,x*y,exp x * sin y]) [pi,1]_[[0.0,1.0],[1.0,0.0],[1.0,1.0],[1.0,3.141592653589793],[19.472221418841606,12.502969588876512]]adCompute the Jacobian using k mode +K and combine the output with the input. This must transpose the result, so ) is faster, and allows more result types.adCompute the Jacobian using k mode + along with the actual answer.adCompute the Jacobian using k mode +W combined with the input using a user specified function, along with the actual answer.ad9Compute the gradient of a function using forward mode AD.Note, this performs O(n) worse than * for n2 inputs, in exchange for better space utilization.adDCompute the gradient and answer to a function using forward mode AD.Note, this performs O(n) worse than + for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and combine the result with the input using a user-specified function.Note, this performs O(n) worse than , for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and the answer, and combine the result with the input using a user-specified function.Note, this performs O(n) worse than - for n2 inputs, in exchange for better space utilization.gradWith' (,) sum [0..4]$(10,[(0,1),(1,1),(2,1),(3,1),(4,1)])adRCompute the product of a vector with the Hessian using forward-on-forward-mode AD.adJCompute the gradient and hessian product using forward-on-forward-mode AD.+k+kNoneadCCompute the directional derivative of a function given a zipped up * of the input values and their derivativesadNCompute the answer and directional derivative of a function given a zipped up * of the input values and their derivativesadMCompute a vector of directional derivatives for a function given a zipped up + of the input values and their derivatives.adYCompute a vector of answers and directional derivatives for a function given a zipped up + of the input values and their derivatives.adThe Y function calculates the first derivative of a scalar-to-scalar function by forward-mode AD diff sin 01.0adThe U function calculates the result and first derivative of scalar-to-scalar function by Forward mode AD   ==  ()   f = f () d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)adThe N function calculates the first derivatives of scalar-to-nonscalar function by Forward mode ADdiffF (\a -> [sin a, cos a]) 0 [1.0,-0.0]adThe \ function calculates the result and first derivatives of a scalar-to-non-scalar function by Forward mode ADdiffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]adBA fast, simple, transposed Jacobian computed with forward-mode AD.ad2A fast, simple, transposed Jacobian computed with Forward mode AD) that combines the output with the input.adCompute the Jacobian using Forward mode AD%. This must transpose the result, so ( is faster and allows more result types.7jacobian (\[x,y] -> [y,x,x+y,x*y,exp x * sin y]) [pi,1]_[[0.0,1.0],[1.0,0.0],[1.0,1.0],[1.0,3.141592653589793],[19.472221418841606,12.502969588876512]]adCompute the Jacobian using Forward mode ADK and combine the output with the input. This must transpose the result, so ) is faster, and allows more result types.adCompute the Jacobian using Forward mode AD along with the actual answer.adCompute the Jacobian using Forward mode ADW combined with the input using a user specified function, along with the actual answer.ad9Compute the gradient of a function using forward mode AD.Note, this performs O(n) worse than * for n2 inputs, in exchange for better space utilization.adDCompute the gradient and answer to a function using forward mode AD.Note, this performs O(n) worse than + for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and combine the result with the input using a user-specified function.Note, this performs O(n) worse than , for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and the answer, and combine the result with the input using a user-specified function.Note, this performs O(n) worse than - for n2 inputs, in exchange for better space utilization.gradWith' (,) sum [0..4]:(10.0,[(0.0,1.0),(1.0,1.0),(2.0,1.0),(3.0,1.0),(4.0,1.0)])PP(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSXadCCompute the directional derivative of a function given a zipped up * of the input values and their derivativesadNCompute the answer and directional derivative of a function given a zipped up * of the input values and their derivativesadMCompute a vector of directional derivatives for a function given a zipped up + of the input values and their derivatives.adYCompute a vector of answers and directional derivatives for a function given a zipped up + of the input values and their derivatives.adThe Y function calculates the first derivative of a scalar-to-scalar function by forward-mode + diff sin 01.0adThe U function calculates the result and first derivative of scalar-to-scalar function by Forward mode +   ==  ()   f = f () d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)adThe N function calculates the first derivatives of scalar-to-nonscalar function by Forward mode +diffF (\a -> [sin a, cos a]) 0 [1.0,-0.0]adThe \ function calculates the result and first derivatives of a scalar-to-non-scalar function by Forward mode +diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]adBA fast, simple, transposed Jacobian computed with forward-mode AD.ad2A fast, simple, transposed Jacobian computed with Forward mode +) that combines the output with the input.adCompute the Jacobian using Forward mode +%. This must transpose the result, so ( is faster and allows more result types.7jacobian (\[x,y] -> [y,x,x+y,x*y,exp x * sin y]) [pi,1]_[[0.0,1.0],[1.0,0.0],[1.0,1.0],[1.0,3.141592653589793],[19.472221418841606,12.502969588876512]]adCompute the Jacobian using Forward mode +K and combine the output with the input. This must transpose the result, so ) is faster, and allows more result types.adCompute the Jacobian using Forward mode + along with the actual answer.adCompute the Jacobian using Forward mode +W combined with the input using a user specified function, along with the actual answer.ad9Compute the gradient of a function using forward mode AD.Note, this performs O(n) worse than * for n2 inputs, in exchange for better space utilization.adDCompute the gradient and answer to a function using forward mode AD.Note, this performs O(n) worse than + for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and combine the result with the input using a user-specified function.Note, this performs O(n) worse than , for n2 inputs, in exchange for better space utilization.adCompute the gradient of a function using forward mode AD and the answer, and combine the result with the input using a user-specified function.Note, this performs O(n) worse than - for n2 inputs, in exchange for better space utilization.gradWith' (,) sum [0..4]:(10.0,[(0.0,1.0),(1.0,1.0),(2.0,1.0),(3.0,1.0),(4.0,1.0)])+P+P(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone =?@ACSXadThe h function calculates the gradient of a non-scalar-to-scalar function with kahn-mode AD in a single pass. grad (\[x,y,z] -> x*y+z) [1,2,3][2,1,1] adThe  s function calculates the result and gradient of a non-scalar-to-scalar function with kahn-mode AD in a single pass.+grad' (\[x,y,z] -> 4*x*exp y+cos z) [1,2,3]L(28.566231899122155,[29.5562243957226,29.5562243957226,-0.1411200080598672]) ad g fE function calculates the gradient of a non-scalar-to-scalar function fq with kahn-mode AD in a single pass. The gradient is combined element-wise with the argument using the function g.  =   (_ dx -> dx)  =   const  ad  g fG calculates the result and gradient of a non-scalar-to-scalar function fp with kahn-mode AD in a single pass the gradient is combined element-wise with the argument using the function g.   ==   (_ dx -> dx) adThe  ` function calculates the jacobian of a non-scalar-to-non-scalar function with kahn AD lazily in m passes for m outputs.$jacobian (\[x,y] -> [y,x,x*y]) [2,1][[0,1],[1,0],[1,2]],jacobian (\[x,y] -> [exp y,cos x,x+y]) [1,2]<[[0.0,7.38905609893065],[-0.8414709848078965,0.0],[1.0,1.0]] adThe  b function calculates both the result and the Jacobian of a nonscalar-to-nonscalar function, using m invocations of kahn AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of   | An alias for gradF'Kghci> jacobian' ([x,y] -> [y,x,x*y]) [2,1] [(1,[0,1]),(2,[1,0]),(2,[1,2])]adR'jacobianWith g f' calculates the Jacobian of a non-scalar-to-non-scalar function f with kahn AD lazily in m passes for m outputs.kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.   =  (_ dx -> dx)   = (f x ->  x  f x) adW g f' calculates both the result and the Jacobian of a nonscalar-to-nonscalar function f, using m invocations of kahn AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.   ==  (_ dx -> dx)ad%Compute the derivative of a function. diff sin 01.0cos 01.0adThe Z function calculates the value and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0)ad]Compute the derivatives of a function that returns a vector with regards to its single input.diffF (\a -> [sin a, cos a]) 0 [1.0,0.0]ad{Compute the derivatives of a function that returns a vector with regards to its single input as well as the primal answer.diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,0.0)]ad Compute the  via the  * of the gradient. gradient is computed in % mode and then the   is computed in % mode.However, since the  f :: f a -> f a9 is square this is not as fast as using the forward-mode  ( of a reverse mode gradient provided by "%.hessian (\[x,y] -> x*y) [1,2] [[0,1],[1,0]]adRCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function via the %-mode Jacobian of the %-mode Jacobian of the function.Less efficient than &'.;hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2 :: RDouble]r[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.131204383757,-2.471726672005],[-2.471726672005,1.131204383757]]]!%34     %     34!(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone =?@ACSXadThe h function calculates the gradient of a non-scalar-to-scalar function with kahn-mode AD in a single pass. grad (\[x,y,z] -> x*y+z) [1,2,3][2,1,1]grad (\[x,y] -> x**y) [0,2] [0.0,NaN]adThe s function calculates the result and gradient of a non-scalar-to-scalar function with kahn-mode AD in a single pass.+grad' (\[x,y,z] -> 4*x*exp y+cos z) [1,2,3]L(28.566231899122155,[29.5562243957226,29.5562243957226,-0.1411200080598672])ad g fE function calculates the gradient of a non-scalar-to-scalar function fq with kahn-mode AD in a single pass. The gradient is combined element-wise with the argument using the function g.  =  (_ dx -> dx)  =  const ad g fG calculates the result and gradient of a non-scalar-to-scalar function fp with kahn-mode AD in a single pass the gradient is combined element-wise with the argument using the function g.  ==  (_ dx -> dx)adThe ` function calculates the jacobian of a non-scalar-to-non-scalar function with kahn AD lazily in m passes for m outputs.$jacobian (\[x,y] -> [y,x,x*y]) [2,1][[0,1],[1,0],[1,2]],jacobian (\[x,y] -> [exp y,cos x,x+y]) [1,2]<[[0.0,7.38905609893065],[-0.8414709848078965,0.0],[1.0,1.0]]adThe b function calculates both the result and the Jacobian of a nonscalar-to-nonscalar function, using m invocations of kahn AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of  | An alias for gradF'Kghci> jacobian' ([x,y] -> [y,x,x*y]) [2,1] [(1,[0,1]),(2,[1,0]),(2,[1,2])]adR'jacobianWith g f' calculates the Jacobian of a non-scalar-to-non-scalar function f with kahn AD lazily in m passes for m outputs.kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  =  (_ dx -> dx)   = (f x ->  x  f x) adW g f' calculates both the result and the Jacobian of a nonscalar-to-nonscalar function f, using m invocations of kahn AD, where m( is the output dimensionality. Applying fmap snd* to the result will recover the result of kInstead of returning the Jacobian matrix, the elements of the matrix are combined with the input using the g.  ==  (_ dx -> dx)ad%Compute the derivative of a function. diff sin 01.0cos 01.0adThe Z function calculates the value and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0) ad]Compute the derivatives of a function that returns a vector with regards to its single input.diffF (\a -> [sin a, cos a]) 0 [1.0,0.0]!ad{Compute the derivatives of a function that returns a vector with regards to its single input as well as the primal answer.diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,0.0)]"ad Compute the " via the * of the gradient. gradient is computed in % mode and then the  is computed in % mode.However, since the  f :: f a -> f a9 is square this is not as fast as using the forward-mode ( of a reverse mode gradient provided by "%.hessian (\[x,y] -> x*y) [1,2] [[0,1],[1,0]]#adRCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function via the %-mode Jacobian of the %-mode Jacobian of the function.Less efficient than &'.;hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2 :: RDouble]r[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.131204383757,-2.471726672005],[-2.471726672005,1.131204383757]]]+% !"#+%"# !(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone >HVXH $adThe $ function finds a zero of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1I[1.0,2.5,2.05,2.000609756097561,2.0000000929222947,2.000000000000002,2.0].last $ take 10 $ findZero ((+1).(^2)) (1 :+ 1) 0.0 :+ 1.0%adThe % function behaves the same as $~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.&adThe & function inverts a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.Example:)last $ take 10 $ inverse sqrt 1 (sqrt 10)10.0'adThe ' function behaves the same as &~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.(adThe ( function find a fixedpoint of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.7390851332151607)adThe ) function behaves the same as (~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.*adThe * function finds an extremum of a scalar function using Newton's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.last $ take 10 $ extremum cos 10.0+adThe + function behaves the same as *~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.,adThe ,b function performs a multivariate optimization, based on the naive-gradient-descent in the file 1stalingrad/examples/flow-tests/pre-saddle-1a.vlad from the VLAD compiler Stalingrad sources. Its output is a stream of increasingly accurate results. (Modulo the usual caveats.)GIt uses reverse mode automatic differentiation to compute the gradient.-ad`Perform a gradient descent using reverse mode automatic differentiation to compute the gradient. $%&'()*+,- $%&'()*+,-(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone&'456>HJSVXO.adFConvex constraint, CC, is a GADT wrapper that hides the existential (sn) which is so prevalent in the rest of the API. This is an engineering convenience for managing the skolems.0adThe 0 function finds a zero of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1I[1.0,2.5,2.05,2.000609756097561,2.0000000929222947,2.000000000000002,2.0].last $ take 10 $ findZero ((+1).(^2)) (1 :+ 1) 0.0 :+ 1.01adThe 1 function behaves the same as 0~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.2adThe 2 function inverts a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.Example:)last $ take 10 $ inverse sqrt 1 (sqrt 10)10.03adThe 3 function behaves the same as 2~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.4adThe 4 function find a fixedpoint of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.73908513321516075adThe 5 function behaves the same as 4~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.6adThe 6 function finds an extremum of a scalar function using Newton's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.last $ take 10 $ extremum cos 10.07adThe 7 function behaves the same as 6~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.8adThe 8b function performs a multivariate optimization, based on the naive-gradient-descent in the file 1stalingrad/examples/flow-tests/pre-saddle-1a.vlad from the VLAD compiler Stalingrad sources. Its output is a stream of increasingly accurate results. (Modulo the usual caveats.)GIt uses reverse mode automatic differentiation to compute the gradient.9adconstrainedDescent obj fs env optimizes the convex function obj$ subject to the convex constraints f <= 0 where f  fs. This is done using a log barrier to model constraints (i.e. Boyd, Chapter 11.3). The returned optimal point for the objective function must satisfy fs , but the initial environment, env, needn't be feasible.adLike 9+ except the initial point must be feasible.;adThe ; function approximates the true gradient of the constFunction by a gradient at a single example. As the algorithm sweeps through the training set, it performs the update for each training example.It uses reverse mode automatic differentiation to compute the gradient The learning rate is constant through out, and is set to 0.001<ad`Perform a gradient descent using reverse mode automatic differentiation to compute the gradient.=adPerform a conjugate gradient descent using reverse mode automatic differentiation to compute the gradient, and using forward-on-forward mode for computing extrema.let sq x = x * x7let rosenbrock [x,y] = sq (1 - x) + 100 * sq (y - sq x)rosenbrock [0,0]1Brosenbrock (conjugateGradientDescent rosenbrock [0, 0] !! 5) < 0.1True>adiPerform a conjugate gradient ascent using reverse mode automatic differentiation to compute the gradient../0123456789:;<=>0123456789./:<=>;(c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone >HVXBBadThe B function finds a zero of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1I[1.0,2.5,2.05,2.000609756097561,2.0000000929222947,2.000000000000002,2.0]CadThe C function behaves the same as BL except that it doesn't truncate the list once the results become constant.DadThe D function inverts a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.Example:)last $ take 10 $ inverse sqrt 1 (sqrt 10)10.0EadThe E function behaves the same as DL except that it doesn't truncate the list once the results become constant.FadThe F function find a fixedpoint of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.7390851332151607GadThe G function behaves the same as FI except that doesn't truncate the list once the results become constant.HadThe H function finds an extremum of a scalar function using Newton's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.last $ take 10 $ extremum cos 10.0IadThe I function behaves the same as HL except that it doesn't truncate the list once the results become constant.BCDEFGHIBCDEFGHI(c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone >HSVX JadThe J function finds a zero of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1I[1.0,2.5,2.05,2.000609756097561,2.0000000929222947,2.000000000000002,2.0]KadThe K function behaves the same as JL except that it doesn't truncate the list once the results become constant.LadThe L function inverts a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.Example:)last $ take 10 $ inverse sqrt 1 (sqrt 10)10.0MadThe M function behaves the same as LL except that it doesn't truncate the list once the results become constant.NadThe N function find a fixedpoint of a scalar function using Newton's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.7390851332151607OadThe O function behaves the same as NI except that doesn't truncate the list once the results become constant.PadThe P function finds an extremum of a scalar function using Newton's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.last $ take 10 $ extremum cos 10.0QadThe Q function behaves the same as PL except that it doesn't truncate the list once the results become constant.RadPerform a conjugate gradient descent using reverse mode automatic differentiation to compute the gradient, and using forward-on-forward mode for computing extrema.let sq x = x * x7let rosenbrock [x,y] = sq (1 - x) + 100 * sq (y - sq x)rosenbrock [0,0]1Brosenbrock (conjugateGradientDescent rosenbrock [0, 0] !! 5) < 0.1TrueSadiPerform a conjugate gradient ascent using reverse mode automatic differentiation to compute the gradient. JKLMNOPQRS JKLMNOPQRS (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneaTUVWXYZ[\]^_`aTUVW\XYZ[]^_`a(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSXgbadThe bj function calculates the gradient of a non-scalar-to-scalar function with sparse-mode AD in a single pass. grad (\[x,y,z] -> x*y+z) [1,2,3][2,1,1]grad (\[x,y] -> x**y) [0,2] [0.0,NaN]+bcdefghijklmno+bcjdefghiklmno(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSX=pad5Compute the answer and all derivatives of a function (a -> a)qad2Compute the zero-padded derivatives of a function (a -> a)rad5Compute the answer and all derivatives of a function  (a -> f a)sad2Compute the zero-padded derivatives of a function  (a -> f a)tad taylor f x compute the Taylor series of f around x.uad taylor0 f x compute the Taylor series of f around x, zero-padded.vad maclaurin f! compute the Maclaurin series of fwad maclaurin f! compute the Maclaurin series of f , zero-paddedxad+Compute the first derivative of a function (a -> a)yad6Compute the answer and first derivative of a function (a -> a)zad/Compute a directional derivative of a function  (f a -> a){ad>Compute the answer and a directional derivative of a function  (f a -> a)|ad/Compute a directional derivative of a function  (f a -> g a)}ad>Compute the answer and a directional derivative of a function  (f a -> g a)~adGiven a function  (f a -> a)P, and a tower of derivatives, compute the corresponding directional derivatives.adGiven a function  (f a -> a)\, and a tower of derivatives, compute the corresponding directional derivatives, zero-paddedadGiven a function  (f a -> g a)O, and a tower of derivatives, compute the corresponding directional derivativesadGiven a function  (f a -> g a)\, and a tower of derivatives, compute the corresponding directional derivatives, zero-paddedpqrstuvwxyz{|}~tuvwxypqrsz{~|}(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone OadThe  function finds a zero of a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1B[1.0,1.8571428571428572,1.9997967892704736,1.9999999999994755,2.0].last $ take 10 $ findZero ((+1).(^2)) (1 :+ 1) 0.0 :+ 1.0adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function inverts a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Note: the "take 10 $ inverse sqrt 1 (sqrt 10)j example that works for Newton's method fails with Halley's method because the preconditions do not hold!adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function find a fixedpoint of a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.7390851332151607adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function finds an extremum of a scalar function using Halley's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.take 10 $ extremum cos 1G[1.0,0.29616942658570555,4.59979519460002e-3,1.6220740159042513e-8,0.0]adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance. (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSX.adThe  function finds a zero of a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Examples: take 10 $ findZero (\x->x^2-4) 1B[1.0,1.8571428571428572,1.9997967892704736,1.9999999999994755,2.0].last $ take 10 $ findZero ((+1).(^2)) (1 :+ 1) 0.0 :+ 1.0adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function inverts a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned. Note: the "take 10 $ inverse sqrt 1 (sqrt 10)j example that works for Newton's method fails with Halley's method because the preconditions do not hold!adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function find a fixedpoint of a scalar function using Halley's method; its output is a stream of increasingly accurate results. (Modulo the usual caveats.)SIf the stream becomes constant ("it converges"), no further elements are returned.!last $ take 10 $ fixedPoint cos 10.7390851332151607adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.adThe  function finds an extremum of a scalar function using Halley's method; produces a stream of increasingly accurate results. (Modulo the usual caveats.) If the stream becomes constant ("it converges"), no further elements are returned.take 10 $ extremum cos 1G[1.0,0.29616942658570555,4.59979519460002e-3,1.6220740159042513e-8,0.0]adThe  function behaves the same as ~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an  instance.!(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneSX/++"(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone>HSVXHad f wv% computes the product of the hessian H$ of a non-scalar-to-scalar function f at w =   wv with a vector v = snd  wv# using "Pearlmutter's method" from  ?http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29.6143, which states: %H v = (d/dr) grad_w (w + r v) | r = 0Or in other words, we take the directional derivative of the gradient. The gradient is calculated in reverse mode, then the directional derivative is calculated in forward mode.ad f wv6 computes both the gradient of a non-scalar-to-scalar f at w =   wv and the product of the hessian H at w with a vector v = snd  wvT using "Pearlmutter's method". The outputs are returned wrapped in the same functor. %H v = (d/dr) grad_w (w + r v) | r = 0Or in other words, we return the gradient and the directional derivative of the gradient. The gradient is calculated in reverse mode, then the directional derivative is calculated in forward mode.adCompute the Hessian via the Jacobian of the gradient. gradient is computed in reverse mode and then the Jacobian is computed in sparse (forward) mode.hessian (\[x,y] -> x*y) [1,2] [[0,1],[1,0]]adPCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function using 'Sparse'-on-'Reverse';hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2 :: RDouble]r[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.131204383757,-2.471726672005],[-2.471726672005,1.131204383757]]]9 +!348;<=>jkmo9+  j!34kmo8<=>;./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYYZ[\]^_`abcdefghijklmnopqrsSVtuvwxyz{|}~                                           !"#$%%&'()*+,-./0123456789:;<=>>?@ABCDEFGHIJKLMNOPQRSTT?@ABCDUVWXYZ[\]^_`abcdeefghijklmnopqrstu*+,-vwxyz{|}%' * + , - v w x y z { | } % '~z{|}vxwy*+,-~z{|}vxwy*+,-~z{|}vxwy*+,-~z{|}vxwy*+,-*+,-vwxyz{|}%'*+,-vwxyz{|}%' * + , - v w x y   %  ' *+,-vwxy%'z{~        !!!!!!!!!z!{!~!!!!!!!"""%"'#$$$$$       ad-4.4.1-AmUt7kKgwFTD6NFIET9GOLNumeric.AD.JetNumeric.AD.ModeNumeric.AD.JacobianNumeric.AD.Internal.TypeNumeric.AD.Internal.OrNumeric.AD.Internal.OnNumeric.AD.Internal.IdentityNumeric.AD.Rank1.TowerNumeric.AD.Internal.TowerNumeric.AD.Rank1.SparseNumeric.AD.Internal.SparseNumeric.AD.Mode.Reverse.Double"Numeric.AD.Internal.Reverse.DoubleNumeric.AD.Mode.ReverseNumeric.AD.Internal.ReverseNumeric.AD.Rank1.KahnNumeric.AD.Internal.KahnNumeric.AD.Rank1.Forward.Double"Numeric.AD.Internal.Forward.DoubleNumeric.AD.Rank1.ForwardNumeric.AD.Internal.ForwardNumeric.AD.Internal.DenseNumeric.AD.Mode.ForwardNumeric.AD.Mode.Forward.DoubleNumeric.AD.Mode.KahnNumeric.AD.Rank1.NewtonNumeric.AD.NewtonNumeric.AD.Rank1.Newton.DoubleNumeric.AD.Newton.DoubleNumeric.AD.Mode.SparseNumeric.AD.Rank1.HalleyNumeric.AD.HalleyNumeric.AD.Mode.Tower Numeric.ADNumeric.AD.Internal.DoctestNumeric.AD.Internal.CombinatorshessianNumeric.AD.Mode.MixedhessianF Control.Arrow&&&gradgrad'gradWith gradWith'Jet:-tailJetheadJetjet$fTraversableJet $fFoldableJet $fFunctorJet $fShowJet$fShowShowableModeScalarisKnownConstant isKnownZeroauto*^^*^/zero $fModeRatio $fModeComplex $fModeWord64 $fModeWord32 $fModeWord16 $fModeWord8 $fModeWord $fModeNatural $fModeInt64 $fModeInt32 $fModeInt16 $fModeInt8 $fModeInteger $fModeInt $fModeFloat $fModeDoubleJacobianDunarylift1lift1_binarylift2lift2_ADrunAD$fModeAD$fEqAD$fOrdAD$fShowAD$fReadAD $fBoundedAD$fNumAD$fRealAD$fFractionalAD $fFloatingAD$fEnumAD $fRealFracAD $fRealFloatAD$fErfAD $fInvErfADOrLRChosenchooseTFrunLrunRchosen$fOrdOr$fEqOr$fModeOr $fRealFloatOr $fInvErfOr$fErfOr $fFloatingOr $fRealFracOr$fFractionalOr$fRealOr$fNumOr $fBoundedOr$fEnumOr $fChosenT $fChosenFOnoff$fModeOn$fEqOn$fEnumOn$fOrdOn $fBoundedOn$fNumOn$fRealOn$fFractionalOn $fRealFracOn $fFloatingOn$fErfOn $fInvErfOn $fRealFloatOnIdrunIdprobeunprobeprobedunprobed$fModeId$fEqId$fOrdId$fShowId$fEnumId $fBoundedId$fNumId$fRealId$fFractionalId $fFloatingId $fRealFracId $fRealFloatId $fSemigroupId $fMonoidId$fDataId$fErfId $fInvErfIdTowergetTowerzeroPadzeroPadF transposePadFdd'tangentsbundlewithDapply getADTowertower $fInvErfTower $fErfTower$fRealFracTower$fRealFloatTower $fRealTower $fEnumTower$fFloatingTower$fFractionalTower $fNumTower$fBoundedTower $fOrdTower $fEqTower$fJacobianTower $fModeTower $fShowTower $fDataTowerGradspacksunpacksGradpackunpackunpack'SparseZeroMonomial emptyMonomial addToMonomialindicesvarsskeletondspartialspartialprimalvgradvgrad'vgradsterms$fInvErfSparse $fErfSparse$fRealFracSparse$fRealFloatSparse $fRealSparse $fEnumSparse$fFloatingSparse$fFractionalSparse $fNumSparse$fBoundedSparse $fOrdSparse $fEqSparse$fJacobianSparse $fModeSparse $fGrad->->->a$fGradSparse[](,)a $fGrads->->a$fGradsSparseCofreea $fShowSparse $fDataSparse ReverseDoubleLiftTapegetTapeHeadCellsNilUnaryBinary derivativeOf derivativeOf'partialspartialArrayOf partialMapOf reifyTapevarvarIdbindunbind unbindWith unbindMapunbindMapWithDefault$fInvErfReverseDouble$fErfReverseDouble$fRealFracReverseDouble$fRealFloatReverseDouble$fRealReverseDouble$fEnumReverseDouble$fFloatingReverseDouble$fFractionalReverseDouble$fNumReverseDouble$fOrdReverseDouble$fEqReverseDouble$fJacobianReverseDouble$fModeReverseDouble$fShowReverseDoubleReverse$fInvErfReverse $fErfReverse$fRealFracReverse$fRealFloatReverse $fRealReverse $fEnumReverse$fFloatingReverse$fFractionalReverse $fNumReverse$fBoundedReverse $fOrdReverse $fEqReverse$fJacobianReverse $fModeReverse $fShowReverseKahnVar derivative derivative' partialArray partialMap $fInvErfKahn $fErfKahn$fRealFracKahn$fRealFloatKahn $fRealKahn $fEnumKahn$fFloatingKahn$fFractionalKahn $fNumKahn $fBoundedKahn $fOrdKahn$fEqKahn$fJacobianKahn $fModeKahn $fMuRefKahn$fGradKahn[](,)a $fShowTape $fDataTape $fShowKahn ForwardDoubletangentunbundlebind'bindWith bindWith' transposeWith$fInvErfForwardDouble$fErfForwardDouble$fRealFracForwardDouble$fRealFloatForwardDouble$fRealForwardDouble$fEnumForwardDouble$fFloatingForwardDouble$fFractionalForwardDouble$fNumForwardDouble$fOrdForwardDouble$fEqForwardDouble$fJacobianForwardDouble$fModeForwardDouble$fReadForwardDouble$fShowForwardDoubleForward$fInvErfForward $fErfForward$fRealFracForward$fRealFloatForward $fRealForward $fEnumForward$fFloatingForward$fFractionalForward $fNumForward$fBoundedForward $fOrdForward $fEqForward$fJacobianForward $fModeForward $fShowForward $fDataForwardDenseds' $fInvErfDense $fErfDense$fRealFracDense$fRealFloatDense $fRealDense $fEnumDense$fFloatingDense$fFractionalDense $fNumDense$fBoundedDense $fOrdDense $fEqDense$fJacobianDense $fModeDense $fShowDensejacobian jacobian' jacobianWith jacobianWith'diffdiff'diffFdiffF'dudu'duFduF' jacobianT jacobianWithThessianProducthessianProduct'findZero findZeroNoEqinverse inverseNoEq fixedPointfixedPointNoEqextremum extremumNoEqgradientDescentgradientAscentCCconstrainedDescentevalstochasticGradientDescentconjugateGradientDescentconjugateGradientAscent $fFunctorSEnv$fFoldableSEnv$fTraversableSEnvgrads jacobianshessian' hessianF'diffsdiffs0diffsFdiffs0Ftaylortaylor0 maclaurin maclaurin0dusdus0dusFdus0FRDoubleShowable!free-5.1.4-63trqO12FkIBmnrJYtGgzmControl.Comonad.CofreeCofreezipWithTbase Data.FoldableFoldableData.Traversable TraversablezipWithDefaultT withPrimalGHC.EnumEnumfromBytakeWhileDifferent<+>sumpartialSmulGHC.Basemapunarilybinarily backPropagateGHC.ArrArraycontainers-0.6.0.1Data.IntMap.InternalIntMapidconst Data.Functor<$>Functor GHC.Floatsincosghc-prim GHC.ClassesEqelemconstrainedConvex' Data.Tuplefst