úÎêù®ÿq      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€ ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw x y z { | } ~  €  ‚ ƒ „ …†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ         ! " # $ % & ' ( ) * +,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm n o p !(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlySafe01<STV& q3Used to sidestep the need for UndecidableInstances.A 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)) :- ...Take the tail of a .Take the head of a . Construct a  by unzipping the layers of a r Comonad.qs3(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone;<=>?AFKQTV-W jallowed to return False for items with a zero derivative, but we'll give more NaNs than strictly necessary Pallowed to return False for zero, but we give more NaN's than strictly necessaryEmbed a constantScalar-vector multiplicationVector-scalar multiplicationScalar division  = lift 0    777(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone7;<=>?AFKQTV0Ü##C is useful for defining new AD primitives in a fairly generic way.#$(%&')*#$%&'()*#$%&'()*None1FKT1¥+,-+,-+,-(c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone &'1<FT4K=>The choice between two AD modes is an AD mode in its own right =?>@ABCDEFGH =>?CBDE@AFGH=>?@A(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone 01<FKST7_X>The composition of two AD modes is an AD mode in its own rightXYZXYZXYZ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone 1;<=>?FKT9*hijklmnhijklmnhij!(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone@ktZip a u f with a v g assuming f! has at least as many entries as g.wZip a u f with a v g assuming f, using a default value after f is exhausted.x"Used internally to define various y combinators.z"Used internally to define various y combinators.{aUsed internally to implement functions which truncate lists after the stream of results convergetwxz{ (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone1;<=>?FQTVCÚ€Tower is an AD  B that calculates a tangent tower by forward AD, and provides fast diffsUU, diffsUF€‚ƒ„…†‡ˆ‰Š‹Œ€‚ƒ„…†‡Šˆ‰‹Œ€‚|6 (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone1;<=>?AFSTTd¥ÿSWe 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 - 1) distinct nth partial derivatives of a function with k inputs.¹3The 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 (c) Edward Kmett 2012-2015BSD3ekmett@gmail.com experimentalGHC onlyNone&'1;<=>?FQTVd® ‚µThis 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.ƒThis 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.Ü^Helper that extracts the derivative of a chain when the chain was constructed with 1 variable.ÝnHelper that extracts both the primal and derivative of a chain when the chain was constructed with 1 variable.„5Used internally to push sensitivities down the chain.ÞDExtract the partials from the current chain for a given AD variable.ß Return an … of Þ# given bounds for the variable IDs.à Return an † of sparse partialsá"Construct a tape that starts with n variables.ÎÐÏÑÒÓÔÕÖ×ÚØÙÛÜÝÞßàáâãäåæçèÎÏÐÑÒÓÔÕÖרÙÚáÞßàÜÝäåçæèâãÛÎÏÐÑÒÓÔÕÖרÙÚ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone1;=>?AFQTVpRüKahn 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.þA Tape\ records the information needed back propagate from the output to each input during reverse   AD.‡*back propagate sensitivities along a tape.hThis returns a list of contributions to the partials. The variable ids returned in the list are likely not unique! Return an … of # given bounds for the variable IDs.  Return an † of sparse partialsøùúûüýþÿ     üýþÿ   øùúû  øùúûüýþÿNone+;<=>?FTr '()*+,-./012 '()*,+-./012'()*(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone1;=>?FQTVuBB mode ADFCalculate the F using forward mode AD.BDECFGHIJKLMNOBCDEJFHGIKLMNOBCDE(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone1;<=>?FQTVwW`acbdefg`abcdefg`abc (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone <>?AQV«¢wThe wk 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]xThe xv 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])yw 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. w == y (_ dx -> dx) ˆ == y ‰ zx 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. x == z (_ dx -> dx) {The {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]]|The |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])]}R'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) ~}W 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)%Compute the derivative of a function. diff sin 01.0€The €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)`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]‚vCompute 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)]ƒCompute 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 w 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]]„•Compute 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 #$.0hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2]‚[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.1312043837568135,-2.4717266720048188],[-2.4717266720048188,1.1312043837568135]]]Îwxyz{|}~€‚ƒ„Îwxyz{|}~ƒ„€‚(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneÛ@…CCompute the directional derivative of a function given a zipped up ‹* of the input values and their derivatives†NCompute the answer and directional derivative of a function given a zipped up ‹* of the input values and their derivatives‡MCompute a vector of directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.ˆYCompute a vector of answers and directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.‰The ‰Y function calculates the first derivative of a scalar-to-scalar function by forward-mode AD diff sin 01.0ŠThe ŠU function calculates the result and first derivative of scalar-to-scalar function by B mode AD Š Œ == Œ %&  Š f = f %& d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)‹The ‹N function calculates the first derivatives of scalar-to-nonscalar function by B mode ADdiffF (\a -> [sin a, cos a]) 0 [1.0,-0.0]ŒThe Œ\ function calculates the result and first derivatives of a scalar-to-non-scalar function by B mode ADdiffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]BA fast, simple, transposed Jacobian computed with forward-mode AD.Ž2A fast, simple, transposed Jacobian computed with B mode AD) that combines the output with the input.Compute the Jacobian using B 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]]Compute the Jacobian using B mode ADK and combine the output with the input. This must transpose the result, so Ž) is faster, and allows more result types.‘Compute the Jacobian using B mode AD along with the actual answer.’Compute the Jacobian using B mode ADW combined with the input using a user specified function, along with the actual answer.“9Compute 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.”DCompute 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.•Compute 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.–Compute 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)])—RCompute the product of a vector with the Hessian using forward-on-forward-mode AD.˜JCompute the gradient and hessian product using forward-on-forward-mode AD.B…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜B“”•–‘’Ž—˜‰Š‹Œ…†‡ˆ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQV è™CCompute the directional derivative of a function given a zipped up ‹* of the input values and their derivativesšNCompute the answer and directional derivative of a function given a zipped up ‹* of the input values and their derivatives›MCompute a vector of directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.œYCompute a vector of answers and directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.The Y function calculates the first derivative of a scalar-to-scalar function by forward-mode + diff sin 01.0žThe žU function calculates the result and first derivative of scalar-to-scalar function by B mode + ž Œ == Œ %&  ž f = f %& d f  diff' sin 0 (0.0,1.0) diff' exp 0 (1.0,1.0)ŸThe ŸN function calculates the first derivatives of scalar-to-nonscalar function by B mode +diffF (\a -> [sin a, cos a]) 0 [1.0,-0.0] The  \ function calculates the result and first derivatives of a scalar-to-non-scalar function by B mode +diffF' (\a -> [sin a, cos a]) 0[(0.0,1.0),(1.0,-0.0)]¡BA fast, simple, transposed Jacobian computed with forward-mode AD.¢2A fast, simple, transposed Jacobian computed with B mode +) that combines the output with the input.£Compute the Jacobian using B 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]]¤Compute the Jacobian using B mode +K and combine the output with the input. This must transpose the result, so ¢) is faster, and allows more result types.¥Compute the Jacobian using B mode + along with the actual answer.¦Compute the Jacobian using B mode +W combined with the input using a user specified function, along with the actual answer.§9Compute 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.¨DCompute 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.©Compute 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.ªCompute 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)])«RCompute the product of a vector with the Hessian using forward-on-forward-mode AD.¬JCompute the gradient and hessian product using forward-on-forward-mode AD.+B™š›œžŸ ¡¢£¤¥¦§¨©ª«¬+B§¨©ª£¥¤¦¡¢«¬žŸ ™š›œNone8Y­CCompute the directional derivative of a function given a zipped up ‹* of the input values and their derivatives®NCompute the answer and directional derivative of a function given a zipped up ‹* of the input values and their derivatives¯MCompute a vector of directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.°YCompute a vector of answers and directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.±The ±Y function calculates the first derivative of a scalar-to-scalar function by forward-mode AD diff sin 01.0²The ²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)³The ³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]´The ´\ 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)]µBA fast, simple, transposed Jacobian computed with forward-mode AD.¶2A fast, simple, transposed Jacobian computed with Forward mode AD) that combines the output with the input.·Compute 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]]¸Compute 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.¹Compute the Jacobian using Forward mode AD along with the actual answer.ºCompute the Jacobian using Forward mode ADW combined with the input using a user specified function, along with the actual answer.»9Compute 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.¼DCompute 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.½Compute 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.¾Compute 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)])'­®¯°±²³´µ¶·¸¹º»¼½¾'»¼½¾·¹¸ºµ¶±²³´­®¯°(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQVf‘¿CCompute the directional derivative of a function given a zipped up ‹* of the input values and their derivativesÀNCompute the answer and directional derivative of a function given a zipped up ‹* of the input values and their derivativesÁMCompute a vector of directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.ÂYCompute a vector of answers and directional derivatives for a function given a zipped up ‹+ of the input values and their derivatives.ÃThe ÃY function calculates the first derivative of a scalar-to-scalar function by forward-mode + diff sin 01.0ÄThe Ä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)ÅThe Å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]ÆThe Æ\ 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)]ÇBA fast, simple, transposed Jacobian computed with forward-mode AD.È2A fast, simple, transposed Jacobian computed with Forward mode +) that combines the output with the input.ÉCompute 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]]ÊCompute 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.ËCompute the Jacobian using Forward mode + along with the actual answer.ÌCompute the Jacobian using Forward mode +W combined with the input using a user specified function, along with the actual answer.Í9Compute 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.ÎDCompute 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.ÏCompute 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.ÐCompute 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)])+'¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐ+'ÍÎÏÐÉËÊÌÇÈÃÄÅÆ¿ÀÁÂ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone ;=>?AQVœKÑThe Ñ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]ÒThe Ò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])ÓÑ 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 ÔÒ 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)ÕThe Õ` 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]]ÖThe Ö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])]×R'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) Ø×W 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)Ù%Compute the derivative of a function. diff sin 01.0cos 01.0ÚThe ÚZ function calculates the value and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0)Û]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]Ü{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)]Ý 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]]ÞRCompute 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 #$.0hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2]‚[[[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 ;=>?AQVÒ“ßThe ß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]àThe à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])áß 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 âà 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)ãThe ã` 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]]äThe ä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])]åR'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) æåW 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)ç%Compute the derivative of a function. diff sin 01.0cos 01.0èThe èZ function calculates the value and derivative, as a pair, of a scalar-to-scalar function. diff' sin 0 (0.0,1.0)é]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]ê{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)]ë 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]]ìRCompute 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 #$.0hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2]‚[[[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 <FTVûN íThe íî 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îThe î 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.ïThe ïæ 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ðThe ð 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.ñThe ñŸ 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òThe ò 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.óThe óî 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ôThe ô 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.õThe õ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.ö`Perform a gradient descent using reverse mode automatic differentiation to compute the gradient. íîïðñòóôõö íîïðñòóôõö(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone&'345<FHQTV93÷FConvex 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.ùThe ùî 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úThe ú 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.ûThe ûæ 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üThe ü 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.ýThe ýŸ 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þThe þ 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.ÿThe ÿî 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.0The  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.The 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.constrainedDescent 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.Like + except the initial point must be feasible.The Ç 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`Perform a gradient descent using reverse mode automatic differentiation to compute the gradient.£Perform 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.1TrueiPerform a conjugate gradient ascent using reverse mode automatic differentiation to compute the gradient.÷øùúûüýþÿùúûüýþÿ÷ø÷ø‘’“”(c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone <FTVUò The  î 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] The   function behaves the same as  L except that it doesn't truncate the list once the results become constant. The  æ 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.0The  function behaves the same as  L except that it doesn't truncate the list once the results become constant.The Ÿ 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.7390851332151607The  function behaves the same as I except that doesn't truncate the list once the results become constant.The î 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.0The  function behaves the same as L except that it doesn't truncate the list once the results become constant.      (c) Edward Kmett 2015BSD3ekmett@gmail.com experimentalGHC onlyNone <FQTVy The î 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]The  function behaves the same as L except that it doesn't truncate the list once the results become constant.The æ 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.0The  function behaves the same as L except that it doesn't truncate the list once the results become constant.The Ÿ 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.7390851332151607The  function behaves the same as I except that doesn't truncate the list once the results become constant.The î 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.0The  function behaves the same as L except that it doesn't truncate the list once the results become constant.£Perform 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.1TrueiPerform a conjugate gradient ascent using reverse mode automatic differentiation to compute the gradient.   (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNonez±ž¡¥¶¸ !"#$%&'()*¥ ¡¶%ž¸!"#$&'()*(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQV¯+The +j 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]+¥+,-./012345678+¥+,3-./01245678(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQV–Ó95Compute the answer and all derivatives of a function (a -> a):2Compute the zero-padded derivatives of a function (a -> a);5Compute the answer and all derivatives of a function  (a -> f a)<2Compute the zero-padded derivatives of a function  (a -> f a)= taylor f x compute the Taylor series of f around x.> taylor0 f x compute the Taylor series of f around x, zero-padded.? maclaurin f! compute the Maclaurin series of f@ maclaurin f! compute the Maclaurin series of f , zero-paddedA+Compute the first derivative of a function (a -> a)B6Compute the answer and first derivative of a function (a -> a)C/Compute a directional derivative of a function  (f a -> a)D>Compute the answer and a directional derivative of a function  (f a -> a)E/Compute a directional derivative of a function  (f a -> g a)F>Compute the answer and a directional derivative of a function  (f a -> g a)GGiven a function  (f a -> a)P, and a tower of derivatives, compute the corresponding directional derivatives.HGiven a function  (f a -> a)\, and a tower of derivatives, compute the corresponding directional derivatives, zero-paddedIGiven a function  (f a -> g a)O, and a tower of derivatives, compute the corresponding directional derivativesJGiven a function  (f a -> g a)\, and a tower of derivatives, compute the corresponding directional derivatives, zero-padded€9:;<=>?@ABCDEFGHIJ€=>?@AB9:;<CDGHEFIJ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneº—KThe Kî 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.0LThe L function behaves the same as K~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.MThe Mæ 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!NThe N function behaves the same as M~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.OThe OŸ 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.7390851332151607PThe P function behaves the same as O~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.QThe Qî 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]RThe R function behaves the same as Q~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.KLMNOPQRKLMNOPQR(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQVÞ SThe Sî 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.0TThe T function behaves the same as S~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.UThe Uæ 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!VThe V function behaves the same as U~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.WThe WŸ 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.7390851332151607XThe X function behaves the same as W~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.YThe Yî 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]ZThe Z function behaves the same as Y~ except that it doesn't truncate the list once the results become constant. This means it can be used with types without an Ž instance.STUVWXYZSTUVWXYZ(c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNoneQVß +€[\]^_`abcdefghijkl+€_`abcd[\]^efijghkl (c) Edward Kmett 2010-2015BSD3ekmett@gmail.com experimentalGHC onlyNone<FQTVømm 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 = 0±Or 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.nn 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 = 0ÄOr 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.o–Compute 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]]pPCompute the order 3 Hessian tensor on a non-scalar-to-non-scalar function using 'Sparse'-on-'Reverse'0hessianF (\[x,y] -> [x*y,x+y,exp x*cos y]) [1,2]‚[[[0.0,1.0],[1.0,0.0]],[[0.0,0.0],[0.0,0.0]],[[-1.1312043837568135,-2.4717266720048188],[-2.4717266720048188,1.1312043837568135]]]4 +ž¸ø  wxyz{|}~™š›œžŸ ¡¢3468[\]^_`abijklmnop4+ wxyz3ø  ž¸{|}~4¡¢o6p8mnŸž []\^™š›œijkl_`ab–,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWWXYZ[\]^_`abcdefghijklmnopqQTrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦ § § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á  à Ä Å Æ Ç È É Ê Ë Ë Ì Í Í Î Ï Ð Ñ ± Ò ¬ ­ Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï Ì ð ï ñ ñ ò ó ó ô õ ö ÷ Ö ø ù ú û ü ý þ ÿ                    ÇÈÉÊñÌð÷öÖúרþÿ !"#$%&'(é)*+,--Ö./¯±0123456789:;<=>?@ABCCðÌ./¯±Ö0123DEFGHIJKLMNOPQRSTðTÌÓUѱVWXYZ[\]^_`abcd ( ) * + e f g h i j k l " $mnopijklqregfh()*+stmnopijklqregfh()*+stmnopijklqregfh()*+mnopijklqregfh()*+()*+efghijkl"$()*+efghijkl"$uvwxyz{|}~uvwxyz{|}€‚~ƒ„…†‡uvwxyz{|uvwxyz{|ƒ„ ( ) * + e f g h ˆ ‰ " Š $ ‹()*+efghˆ‰"Š$‹ŒŽ‘’“ijmnop”•–—uvwxyz{|uvwxyz{|ŒŽ‘’“ijmnop”•–— s t " $˜™š›˜!œžŸ ¡!¢!£¤¥!¦!§ ¨ž© ª «¬­ ¨ ® ¯ °±²³´µ°¬¶¬·¸¹¬º»¼»½¾¿ÀžÁÂÃÃÄÅÆÇÈad-4.3.5-1rXB1JmwcwlDYfFkQarLZmNumeric.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.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.CombinatorshessianNumeric.AD.Mode.MixedhessianF Control.Arrow&&&Numeric.AD.Mode.Wengertgradgrad'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 $fDataSparseReverseLiftTapegetTapeHeadCellsNilUnaryBinary derivativeOf derivativeOf'partialspartialArrayOf partialMapOf reifyTapevarvarIdbindunbind unbindWith unbindMapunbindMapWithDefault$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 maclaurin0dusdus0dusFdus0FShowable"free-4.12.4-AJ3YKyaLn6v1NcmsinxKEAControl.Comonad.CofreeCofreezipWithTbase Data.FoldableFoldableData.Traversable TraversablezipWithDefaultT withPrimalGHC.EnumEnumfromBytakeWhileDifferent<+>sumpartialSmulGHC.Basemapunarilybinarily backPropagateGHC.ArrArraycontainers-0.5.10.2Data.IntMap.InternalIntMapidconst Data.Functor<$>Functor GHC.Floatsincosghc-prim GHC.ClassesEqelemconstrainedConvex'SEnvsValueorigEnv Data.Tuplefst