From 90e9ac2faa5fe1889f94f4c51201f89b00e795ca Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Fri, 21 Apr 2017 15:20:09 -0400 Subject: [PATCH 1/3] derivative for in-place functions of the form f!(::AbstractArray, ::Real) --- src/config.jl | 16 ++++++++++++++++ src/derivative.jl | 35 +++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/config.jl b/src/config.jl index da477d05..0089664c 100644 --- a/src/config.jl +++ b/src/config.jl @@ -44,6 +44,22 @@ Base.eltype(cfg::AbstractConfig) = eltype(typeof(cfg)) @inline chunksize(::AbstractConfig{T,N}) where {T,N} = N +#################### +# DerivativeConfig # +#################### + +struct DerivativeConfig{T,D} <: AbstractConfig{T,1} + duals::D +end + +function DerivativeConfig(::F, + y::AbstractArray{Y}, + x::X, + ::T = Tag(F, X)) where {F,X<:Real,Y,T} + duals = similar(y, Dual{Y,1}) + return DerivativeConfig{T,typeof(duals)}(duals) +end + ################## # GradientConfig # ################## diff --git a/src/derivative.jl b/src/derivative.jl index 9c04171a..2131eacf 100644 --- a/src/derivative.jl +++ b/src/derivative.jl @@ -2,14 +2,38 @@ # API methods # ############### +const AllowedDerivativeConfig{F,H} = Union{DerivativeConfig{Tag{F,H}}, DerivativeConfig{Tag{Void,H}}} + +derivative(f!, y, x, cfg::DerivativeConfig) = throw(ConfigHismatchError(f, cfg)) +derivative!(out, f!, y, x, cfg::DerivativeConfig) = throw(ConfigHismatchError(f, cfg)) + @inline function derivative(f::F, x::R) where {F,R<:Real} T = typeof(Tag(F, R)) return extract_derivative(f(Dual{T}(x, one(x)))) end +@inline function derivative(f!::F, y, x::R, cfg::AllowedDerivativeConfig{F,H} = DerivativeConfig(f!, y, x)) where {F,R<:Real,H} + ydual = cfg.duals + seed!(ydual, y) + f!(ydual, Dual{Tag{F,H}}(x, one(x))) + map!(value, y, ydual) + return extract_derivative(ydual) +end + @inline function derivative!(out, f::F, x::R) where {F,R<:Real} - T = typeof(Tag(F, typeof(x))) - extract_derivative!(out, f(Dual{T}(x, one(x)))) + T = typeof(Tag(F, R)) + ydual = f(Dual{T}(x, one(x))) + extract_value!(out, ydual) + extract_derivative!(out, ydual) + return out +end + +@inline function derivative!(out, f!::F, y, x::R, cfg::AllowedDerivativeConfig{F,H} = DerivativeConfig(f!, y, x)) where {F,R<:Real,H} + ydual = cfg.duals + seed!(ydual, y) + f!(ydual, Dual{Tag{F,H}}(x, one(x))) + extract_value!(out, y, ydual) + extract_derivative!(out, ydual) return out end @@ -28,9 +52,4 @@ end #----------# extract_derivative!(out::AbstractArray, y::AbstractArray) = map!(extract_derivative, out, y) - -function extract_derivative!(out::DiffResult, y) - DiffBase.value!(value, out, y) - DiffBase.derivative!(extract_derivative, out, y) - return out -end +extract_derivative!(out::DiffResult, y) = DiffBase.derivative!(extract_derivative, out, y) From 8d3550d700ee67dbd5689b8a4efb8f131a42cce3 Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Fri, 28 Apr 2017 14:09:47 -0400 Subject: [PATCH 2/3] add in-place derivative tests --- src/config.jl | 4 ++-- test/DerivativeTest.jl | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/config.jl b/src/config.jl index 0089664c..4055be4b 100644 --- a/src/config.jl +++ b/src/config.jl @@ -55,8 +55,8 @@ end function DerivativeConfig(::F, y::AbstractArray{Y}, x::X, - ::T = Tag(F, X)) where {F,X<:Real,Y,T} - duals = similar(y, Dual{Y,1}) + ::T = Tag(F, X)) where {F,X<:Real,Y<:Real,T} + duals = similar(y, Dual{T,Y,1}) return DerivativeConfig{T,typeof(duals)}(duals) end diff --git a/test/DerivativeTest.jl b/test/DerivativeTest.jl index 85300ba3..691d4915 100644 --- a/test/DerivativeTest.jl +++ b/test/DerivativeTest.jl @@ -45,4 +45,46 @@ for f in DiffBase.NUMBER_TO_ARRAY_FUNCS @test isapprox(DiffBase.derivative(out), d) end +for f! in DiffBase.INPLACE_NUMBER_TO_ARRAY_FUNCS + println(" ...testing $f!") + m, n = 3, 2 + y = zeros(m, n) + f = x -> (tmp = similar(y, promote_type(eltype(y), typeof(x)), m, n); f!(tmp, x); tmp) + v = f(x) + cfg = ForwardDiff.DerivativeConfig(f!, y, x) + d = ForwardDiff.derivative(f, x) + + fill!(y, 0.0) + @test isapprox(ForwardDiff.derivative(f!, y, x), d) + @test isapprox(v, y) + + fill!(y, 0.0) + @test isapprox(ForwardDiff.derivative(f!, y, x, cfg), d) + @test isapprox(v, y) + + out = similar(v) + fill!(y, 0.0) + ForwardDiff.derivative!(out, f!, y, x) + @test isapprox(out, d) + @test isapprox(v, y) + + out = similar(v) + fill!(y, 0.0) + ForwardDiff.derivative!(out, f!, y, x, cfg) + @test isapprox(out, d) + @test isapprox(v, y) + + out = DiffBase.DiffResult(similar(v), similar(d)) + ForwardDiff.derivative!(out, f!, y, x) + @test isapprox(v, y) + @test isapprox(DiffBase.value(out), v) + @test isapprox(DiffBase.derivative(out), d) + + out = DiffBase.DiffResult(similar(v), similar(d)) + ForwardDiff.derivative!(out, f!, y, x, cfg) + @test isapprox(v, y) + @test isapprox(DiffBase.value(out), v) + @test isapprox(DiffBase.derivative(out), d) +end + end # module From d1e732cc29fc479cad233d1fe7d272b437796a7b Mon Sep 17 00:00:00 2001 From: Jarrett Revels Date: Sat, 29 Apr 2017 12:22:52 -0400 Subject: [PATCH 3/3] add docs for in-place derivative --- docs/_rst/source/basic_api.rst | 19 +++++++++++++------ docs/_sources/basic_api.txt | 19 +++++++++++++------ docs/basic_api.html | 23 +++++++++++++++++------ docs/genindex.html | 2 +- docs/searchindex.js | 2 +- 5 files changed, 45 insertions(+), 20 deletions(-) diff --git a/docs/_rst/source/basic_api.rst b/docs/_rst/source/basic_api.rst index 96115abd..49deb0e6 100644 --- a/docs/_rst/source/basic_api.rst +++ b/docs/_rst/source/basic_api.rst @@ -8,15 +8,22 @@ Use ``ForwardDiff.derivative`` to differentiate functions of the form ``f(::Real .. function:: ForwardDiff.derivative!(out, f, x) - Compute :math:`f'(x)`, storing the output in ``out``. If ``x`` is a ``Tuple``, - then ``f`` will be called as ``f(x...)`` and the derivatives with respect to - each element in `x` will be stored in the respective element of ``out`` (which - should also be a ``Tuple``). + Compute :math:`f'(x)`, storing the output in ``out``. + +.. function:: ForwardDiff.derivative!(out, f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x)) + + Compute and return :math:`f'(x)`, storing the output in ```out``. This form assumes that + :math:`f'(x)` can be called as ``f!(y, x)`` such that the value result is stored in + ``y``. .. function:: ForwardDiff.derivative(f, x) - Compute and return :math:`f'(x)`. If ``x`` is a ``Tuple``, ``f`` will be - called as ``f(x...)``, and a ``Tuple`` of derivatives will be returned. + Compute and return :math:`f'(x)`. + +.. function:: ForwardDiff.derivative(f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x)) + + Compute and return :math:`f'(x)`. This form assumes that :math:`f'(x)` can be called as + ``f!(y, x)`` such that the value result is stored in ``y``. Gradients of :math:`f(x) : \mathbb{R}^{n_1} \times \dots \times \mathbb{R}^{n_k} \to \mathbb{R}` ------------------------------------------------------------------------------------------------ diff --git a/docs/_sources/basic_api.txt b/docs/_sources/basic_api.txt index 96115abd..49deb0e6 100644 --- a/docs/_sources/basic_api.txt +++ b/docs/_sources/basic_api.txt @@ -8,15 +8,22 @@ Use ``ForwardDiff.derivative`` to differentiate functions of the form ``f(::Real .. function:: ForwardDiff.derivative!(out, f, x) - Compute :math:`f'(x)`, storing the output in ``out``. If ``x`` is a ``Tuple``, - then ``f`` will be called as ``f(x...)`` and the derivatives with respect to - each element in `x` will be stored in the respective element of ``out`` (which - should also be a ``Tuple``). + Compute :math:`f'(x)`, storing the output in ``out``. + +.. function:: ForwardDiff.derivative!(out, f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x)) + + Compute and return :math:`f'(x)`, storing the output in ```out``. This form assumes that + :math:`f'(x)` can be called as ``f!(y, x)`` such that the value result is stored in + ``y``. .. function:: ForwardDiff.derivative(f, x) - Compute and return :math:`f'(x)`. If ``x`` is a ``Tuple``, ``f`` will be - called as ``f(x...)``, and a ``Tuple`` of derivatives will be returned. + Compute and return :math:`f'(x)`. + +.. function:: ForwardDiff.derivative(f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x)) + + Compute and return :math:`f'(x)`. This form assumes that :math:`f'(x)` can be called as + ``f!(y, x)`` such that the value result is stored in ``y``. Gradients of :math:`f(x) : \mathbb{R}^{n_1} \times \dots \times \mathbb{R}^{n_k} \to \mathbb{R}` ------------------------------------------------------------------------------------------------ diff --git a/docs/basic_api.html b/docs/basic_api.html index 862d63fb..1bb1f5f6 100644 --- a/docs/basic_api.html +++ b/docs/basic_api.html @@ -152,17 +152,28 @@

Derivatives of \(f(x) : \mathbb{R} \to \mathbb{R}^{n_1} \
ForwardDiff.derivative!(out, f, x)
-

Compute \(f'(x)\), storing the output in out. If x is a Tuple, -then f will be called as f(x...) and the derivatives with respect to -each element in x will be stored in the respective element of out (which -should also be a Tuple).

+

Compute \(f'(x)\), storing the output in out.

+
+ +
+
+ForwardDiff.derivative!(out, f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x))
+

Compute and return \(f'(x)\), storing the output in `out. This form assumes that +\(f'(x)\) can be called as f!(y, x) such that the value result is stored in +y.

ForwardDiff.derivative(f, x)ΒΆ
-

Compute and return \(f'(x)\). If x is a Tuple, f will be -called as f(x...), and a Tuple of derivatives will be returned.

+

Compute and return \(f'(x)\).

+
+ +
+
+ForwardDiff.derivative(f!, y, x, cfg = ForwardDiff.DerivativeConfig(f!, y, x))
+

Compute and return \(f'(x)\). This form assumes that \(f'(x)\) can be called as +f!(y, x) such that the value result is stored in y.

diff --git a/docs/genindex.html b/docs/genindex.html index 28e76d10..9eba06cb 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -145,7 +145,7 @@

F

-
ForwardDiff.derivative() (built-in function) +
ForwardDiff.derivative() (built-in function), [1]
diff --git a/docs/searchindex.js b/docs/searchindex.js index 541ae921..9313df25 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:49,filenames:["advanced_usage","basic_api","contributing","how_it_works","index","install","limitations","upgrade"],objects:{ForwardDiff:{GradientConfig:[1,0,1,""],HessianConfig:[1,0,1,""],JacobianConfig:[1,0,1,""],derivative:[1,0,1,""],gradient:[1,0,1,""],hessian:[1,0,1,""],jacobian:[1,0,1,""]}},objnames:{"0":["py","function","Python function"]},objtypes:{"0":"py:function"},terms:{"abstract":3,"break":6,"byte":0,"case":[0,1,2,3],"catch":1,"default":[0,1,7],"export":7,"final":0,"import":2,"long":6,"true":[0,7],"try":0,"void":0,"while":[0,1,4],_70842:0,_70852:0,abil:1,abl:0,about:[3,4,7],abov:[3,7],abs2:2,abstractarrai:[1,6],abstractconfig:0,abstractvector:3,accept:[2,6],accomplish:[0,2],accuraci:4,actual:[0,2],add:[0,2,5],addit:[0,2,3],advantag:4,advis:1,affect:0,after:2,algorithm:4,align:0,all:[0,1,2,6,7],alloc:[0,1],allow:[0,1,3],allresult:7,almost:0,alreadi:2,also:[0,1,6],amen:0,ani:[1,4,6],answer:[0,7],api:0,apply:2,appropri:[0,2],aren:[0,2],arg:[0,1],argument:[1,6],arithmet:0,around:2,arrai:[0,2,6],articl:4,arxiv:4,assert:0,assign:6,assum:3,atan2:2,attempt:0,author:[0,4],auto:2,auto_defined_unary_funcs:2,automat:[0,1,2,3,4,7],avoid:[6,7],awai:3,ax_mul_bx:6,bandwidth:0,base:[0,1,3],basic:0,been:2,befor:0,behavior:[0,3],behvaior:0,below:1,benchmark:0,best:0,better:0,between:7,binari:0,bitcast:0,bitcod:0,blas:6,block:0,both:[3,4],branch:2,brief:2,bring:0,buffer:[0,1],build:0,built:0,bundl:1,calcul:[0,3],call:[0,1,3,6],callabl:4,can:[0,1,2,3,4,6,7],cannot:[1,6],cast:0,caus:0,cbrt:2,central:3,certain:0,cfg10:0,cfg1:0,cfg4:0,cfg:[0,1],chain:3,chang:[2,7],check:[0,2],chunk_siz:7,cite:4,clearer:7,code:[0,2,3,6,7],code_llvm:0,collect:6,comment:6,common:4,compil:0,complet:0,compon:[0,3],compos:[0,3,6,7],comput:[0,1],conflict:7,confus:[1,3],conjunct:0,consid:2,constant:0,construct:[0,1],constructor:[0,1],consult:0,contain:[1,3],conveni:1,copi:0,correct:0,cost:0,could:0,coupl:3,cours:0,creat:4,cross:3,cumprod:0,current:[5,7],data:0,decreas:[0,1],defin:[0,2,7],definit:2,depend:[0,4],deriv:0,describ:0,descript:2,detail:[3,6,7],develop:4,diffbas:[0,1,7],differ:1,differenc:4,different:0,differenti:[1,2,3,4,6],diffresult:[0,1],dimens:0,dimension:[3,7],directori:0,disabl:0,discuss:3,divid:0,document:[0,4,6,7],doe:[0,1,2,3],doesn:[0,6],don:[2,3],done:2,doubl:0,down:2,downstream:0,drastic:1,dual:[0,2],dualtest:2,dure:0,dynam:0,each:[0,1,3],easi:[2,3],easiest:2,easili:[0,1],element:[0,1,2],elementari:3,eltyp:0,emit:0,enabl:[0,3,4],encourag:3,end:[0,3,7],enough:6,entir:[0,3],erron:0,error:[0,7],essenti:[0,2],evalu:[0,3,4],even:0,evenli:0,everyth:2,exactli:1,examin:3,exampl:[0,2,3,6,7],except:6,execut:[0,3],exist:[0,2,7],exp2:2,exp:2,expens:0,explic:0,explicit:6,explicitli:[0,7],explictli:1,expm1:2,extend:3,extern:6,extra:[0,1,3],extract:3,fadd:0,fairli:2,famili:1,familiar:3,featur:[0,3,7],feed:1,fell:0,few:[2,7],field:3,find:4,fine:0,finit:4,first:0,flag:0,flexibl:[1,7],float64:0,follow:[3,4],fork:2,form:[0,1],forward:[3,4],forwarddiff:0,free:0,from:[0,2,3,4],fulli:7,futur:0,gener:[0,2,3,4,6,7],getelementptr:0,github:[2,4],gradient:0,gradientconfig:[0,1,7],guess:0,have:[0,2,3,7],heavili:0,help:7,here:[0,2,3,6,7],hessianconfig:1,hessianresult:7,heurist:0,higher:[0,3,4],highli:1,hold:0,horribl:0,how:0,howev:[0,1],http:4,hyper:3,i32:0,i64:0,ident:0,imag:0,improv:2,inbound:0,incorrectli:0,increas:0,inform:[0,1,3,6],inher:0,inject:6,input:[0,1,3,6],insert:0,instal:5,installat:4,instanc:[1,3],instead:[0,1,6,7],instruct:0,int64:0,intern:7,introduc:3,inv:2,isinf:0,isnan:0,jacobian:0,jacobianconfig:1,job:3,journal:4,julia:[0,2,3,4,5,6],julia_:0,kei:3,kindli:4,know:0,larger:0,lead:7,learn:[0,3,4,7],length:[0,7],less:7,let:[0,3],librari:0,like:[1,3,6],likewis:0,limit:4,link:2,list:[2,6],llvm:0,load:0,local:0,locat:0,log10:2,log1p:2,log2:2,log:[0,2],longer:7,look:[2,3],lubin:4,machin:0,magic:7,mai:[1,2,6],maintain:7,major:0,make:[0,2,3,6],manag:5,mani:0,manual:[0,1],master:2,mathemat:3,matrix:[0,1],mean:6,memori:[0,1],mention:2,merg:2,method:[0,1,4],might:0,mirror:0,mode:[0,3,4],modifi:1,modul:0,more:[0,1,7],multipl:3,multipli:[0,3],multithread:4,multithreadconfig:7,must:[6,7],mutat:[0,7],name:2,namespac:7,nansafe_mode_enabled:0,nativ:4,natur:[3,6],need:[0,2],nest:3,newcom:2,noalia:0,non:[2,4,6],note:[0,1],noth:1,notic:0,now:7,ntupl:3,number:[0,2],numer:3,object:4,obvious:2,occur:7,offici:6,old:7,older:4,omit:1,once:2,one:0,onli:[0,6],oop:0,open:2,oper:0,optim:[0,2],org:4,origin:3,other:[0,1,3,4,7],otherwis:0,our:[0,3,7],out:[0,1,7],outlin:2,outperform:4,output:[0,1,3],output_length:7,over:4,overcom:0,overload:3,overtop:3,own:[0,7],packag:[0,2,3,5,7],page:4,papamark:4,paper:4,paramet:[1,3],pariti:7,part:2,partial:[0,3],pass:[1,2,3],perform:[0,1,4],performantli:3,perhap:0,perturb:[0,1,3],pick:[0,2],pkg:[2,5],place:[0,2,7],plan:0,pleas:0,plethora:3,poison:0,possibl:[0,1],pre:0,prealloc:1,preserv:0,prevent:[0,1,3],primal:0,process:[0,2,3],program:6,propag:[0,6],properti:3,propog:3,proport:0,provid:[0,1,2,3,7],qualifi:7,question:0,rand:0,rather:0,reader:3,real:[1,3,6],realiti:[0,3],realli:4,reason:0,rebuild:0,recomend:1,reduc:[0,1],redund:0,refer:[6,7],rehash:3,reimplement:7,relev:[0,2],reli:0,remain:0,remaind:0,replac:2,repositori:2,repres:3,request:4,requir:[0,1,2,4],reshap:[0,7],resolv:2,resourc:4,respect:1,ret:0,retriev:[0,4],reus:1,revel:4,revelslubinpapamarkou2016:4,revolv:2,roadblock:6,rosenbrock:0,rule:[2,3,6],run:[0,2,6],runtim:[0,6],sacrif:0,safe:0,sai:0,sake:1,same:2,scope:0,scroll:2,second:[0,1,3],section:[1,2],see:[0,1,2,6,7],seed:[1,3],seen:[0,6],select:[0,1],sensit:0,set:[0,4],sever:[0,1],shape:[0,1],share:2,should:[0,1,2],show:0,signatur:6,similar:[0,3],simpl:3,simpli:5,sin:[2,3],sinc:[0,7],singl:6,slpvectorizerpass:0,smaller:0,some:[0,2,6,7],sourc:0,special:2,specif:[0,1,6],specifi:1,speed:4,speedup:0,sqrt:2,squar:0,src:[0,2],sret:0,stabil:0,stabl:0,start:0,state:0,storag:[1,6],store:[0,1,3],struct:3,style:6,submit:2,substanti:2,subtyp:6,suit:[0,2],suitabl:2,support:[0,2,3,5,6,7],sure:2,swoop:0,symbol:2,system:0,tag:[0,3],take:[0,1,3,4,7],tan:2,target:[0,1,3,6],task:0,techniqu:[0,4,6],tensor:[0,7],term:3,test:2,than:0,thei:2,them:[1,3,7],thi:[0,1,2,3,4,6,7],thing:0,third:3,though:1,through:[2,6],thu:[0,3,6,7],time:0,titl:[2,4],top:0,transform:7,tune:0,tupl:1,tutori:2,two:[0,2,3],type:0,undefin:0,understand:3,unexport:4,unstabl:0,upgrade:4,url:4,usag:1,use:1,user:[0,1,3,4,6,7],usual:0,usualli:0,util:0,vari:4,variabl:0,vector_hessian:0,version:[0,4],via:0,wai:[0,2,3],want:0,well:[0,3,6],what:[0,2],whatev:2,when:[0,1,2],where:[0,1,3],wherea:0,whether:0,which:[0,1,2,3],wikipedia:4,wish:2,within:[3,6],without:[0,2,3],won:3,word:0,work:[0,1,2],workflow:2,would:[0,3],write:[0,2],written:6,year:4,yield:0,you:[0,1,2,4,7],your:[0,2,4,6],yourself:[1,2],zero:0},titles:["Advanced Usage Guide","Basic ForwardDiff API","How to Contribute","How ForwardDiff Works","ForwardDiff.jl","Installation and Version Requirements","Limitations of ForwardDiff","Upgrading from Older Versions of ForwardDiff"],titleterms:{"function":[0,2,7],"new":2,"public":4,"return":0,abstractconfig:1,access:0,adding:2,advanc:0,api:[1,3,7],basic:1,calculu:2,chunk:[0,7],configur:0,contribut:2,creat:7,deriv:1,differenti:7,dual:3,enabl:7,fix:0,forwarddiff:[1,2,3,4,6,7],from:7,gradient:1,guid:0,hessian:[0,1],higher:7,how:[2,3],implement:[2,3],inf:0,installat:5,issu:0,jacobian:1,limit:6,lower:[0,7],manual:2,multithread:7,nan:0,number:3,older:7,optimiz:2,order:[0,7],requir:5,result:[0,7],retriev:7,set:7,simd:0,size:[0,7],type:1,unari:2,unexport:7,upgrade:7,usage:0,valu:0,vector:0,version:[5,7],via:2,work:3}}) \ No newline at end of file +Search.setIndex({envversion:49,filenames:["advanced_usage","basic_api","contributing","how_it_works","index","install","limitations","upgrade"],objects:{ForwardDiff:{GradientConfig:[1,0,1,""],HessianConfig:[1,0,1,""],JacobianConfig:[1,0,1,""],derivative:[1,0,1,""],gradient:[1,0,1,""],hessian:[1,0,1,""],jacobian:[1,0,1,""]}},objnames:{"0":["py","function","Python function"]},objtypes:{"0":"py:function"},terms:{"abstract":3,"break":6,"byte":0,"case":[0,1,2,3],"catch":1,"default":[0,1,7],"export":7,"final":0,"import":2,"long":6,"true":[0,7],"try":0,"void":0,"while":[0,1,4],_70842:0,_70852:0,abil:1,abl:0,about:[3,4,7],abov:[3,7],abs2:2,abstractarrai:[1,6],abstractconfig:0,abstractvector:3,accept:[2,6],accomplish:[0,2],accuraci:4,actual:[0,2],add:[0,2,5],addit:[0,2,3],advantag:4,advis:1,affect:0,after:2,algorithm:4,align:0,all:[0,1,2,6,7],alloc:[0,1],allow:[0,1,3],allresult:7,almost:0,alreadi:2,also:[0,1,6],amen:0,ani:[1,4,6],answer:[0,7],api:0,apply:2,appropri:[0,2],aren:[0,2],arg:[0,1],argument:[1,6],arithmet:0,around:2,arrai:[0,2,6],articl:4,arxiv:4,assert:0,assign:6,assum:[1,3],atan2:2,attempt:0,author:[0,4],auto:2,auto_defined_unary_funcs:2,automat:[0,1,2,3,4,7],avoid:[6,7],awai:3,ax_mul_bx:6,bandwidth:0,base:[0,1,3],basic:0,been:2,befor:0,behavior:[0,3],behvaior:0,below:1,benchmark:0,best:0,better:0,between:7,binari:0,bitcast:0,bitcod:0,blas:6,block:0,both:[3,4],branch:2,brief:2,bring:0,buffer:[0,1],build:0,built:0,bundl:1,calcul:[0,3],call:[0,1,3,6],callabl:4,can:[0,1,2,3,4,6,7],cannot:[1,6],cast:0,caus:0,cbrt:2,central:3,certain:0,cfg10:0,cfg1:0,cfg4:0,cfg:[0,1],chain:3,chang:[2,7],check:[0,2],chunk_siz:7,cite:4,clearer:7,code:[0,2,3,6,7],code_llvm:0,collect:6,comment:6,common:4,compil:0,complet:0,compon:[0,3],compos:[0,3,6,7],comput:[0,1],conflict:7,confus:[1,3],conjunct:0,consid:2,constant:0,construct:[0,1],constructor:[0,1],consult:0,contain:[1,3],conveni:1,copi:0,correct:0,cost:0,could:0,coupl:3,cours:0,creat:4,cross:3,cumprod:0,current:[5,7],data:0,decreas:[0,1],defin:[0,2,7],definit:2,depend:[0,4],deriv:0,derivativeconfig:1,describ:0,descript:2,detail:[3,6,7],develop:4,diffbas:[0,1,7],differ:1,differenc:4,different:0,differenti:[1,2,3,4,6],diffresult:[0,1],dimens:0,dimension:[3,7],directori:0,disabl:0,discuss:3,divid:0,document:[0,4,6,7],doe:[0,1,2,3],doesn:[0,6],don:[2,3],done:2,doubl:0,down:2,downstream:0,drastic:1,dual:[0,2],dualtest:2,dure:0,dynam:0,each:[0,3],easi:[2,3],easiest:2,easili:[0,1],element:[0,2],elementari:3,eltyp:0,emit:0,enabl:[0,3,4],encourag:3,end:[0,3,7],enough:6,entir:[0,3],erron:0,error:[0,7],essenti:[0,2],evalu:[0,3,4],even:0,evenli:0,everyth:2,exactli:1,examin:3,exampl:[0,2,3,6,7],except:6,execut:[0,3],exist:[0,2,7],exp2:2,exp:2,expens:0,explic:0,explicit:6,explicitli:[0,7],explictli:1,expm1:2,extend:3,extern:6,extra:[0,1,3],extract:3,fadd:0,fairli:2,famili:1,familiar:3,featur:[0,3,7],feed:1,fell:0,few:[2,7],field:3,find:4,fine:0,finit:4,first:0,flag:0,flexibl:[1,7],float64:0,follow:[3,4],fork:2,form:[0,1],forward:[3,4],forwarddiff:0,free:0,from:[0,2,3,4],fulli:7,futur:0,gener:[0,2,3,4,6,7],getelementptr:0,github:[2,4],gradient:0,gradientconfig:[0,1,7],guess:0,have:[0,2,3,7],heavili:0,help:7,here:[0,2,3,6,7],hessianconfig:1,hessianresult:7,heurist:0,higher:[0,3,4],highli:1,hold:0,horribl:0,how:0,howev:[0,1],http:4,hyper:3,i32:0,i64:0,ident:0,imag:0,improv:2,inbound:0,incorrectli:0,increas:0,inform:[0,1,3,6],inher:0,inject:6,input:[0,1,3,6],insert:0,instal:5,installat:4,instanc:[1,3],instead:[0,1,6,7],instruct:0,int64:0,intern:7,introduc:3,inv:2,isinf:0,isnan:0,jacobian:0,jacobianconfig:1,job:3,journal:4,julia:[0,2,3,4,5,6],julia_:0,kei:3,kindli:4,know:0,larger:0,lead:7,learn:[0,3,4,7],length:[0,7],less:7,let:[0,3],librari:0,like:[1,3,6],likewis:0,limit:4,link:2,list:[2,6],llvm:0,load:0,local:0,locat:0,log10:2,log1p:2,log2:2,log:[0,2],longer:7,look:[2,3],lubin:4,machin:0,magic:7,mai:[1,2,6],maintain:7,major:0,make:[0,2,3,6],manag:5,mani:0,manual:[0,1],master:2,mathemat:3,matrix:[0,1],mean:6,memori:[0,1],mention:2,merg:2,method:[0,1,4],might:0,mirror:0,mode:[0,3,4],modifi:1,modul:0,more:[0,1,7],multipl:3,multipli:[0,3],multithread:4,multithreadconfig:7,must:[6,7],mutat:[0,7],name:2,namespac:7,nansafe_mode_enabled:0,nativ:4,natur:[3,6],need:[0,2],nest:3,newcom:2,noalia:0,non:[2,4,6],note:[0,1],noth:1,notic:0,now:7,ntupl:3,number:[0,2],numer:3,object:4,obvious:2,occur:7,offici:6,old:7,older:4,omit:1,once:2,one:0,onli:[0,6],oop:0,open:2,oper:0,optim:[0,2],org:4,origin:3,other:[0,1,3,4,7],otherwis:0,our:[0,3,7],out:[0,1,7],outlin:2,outperform:4,output:[0,1,3],output_length:7,over:4,overcom:0,overload:3,overtop:3,own:[0,7],packag:[0,2,3,5,7],page:4,papamark:4,paper:4,paramet:[1,3],pariti:7,part:2,partial:[0,3],pass:[1,2,3],perform:[0,1,4],performantli:3,perhap:0,perturb:[0,1,3],pick:[0,2],pkg:[2,5],place:[0,2,7],plan:0,pleas:0,plethora:3,poison:0,possibl:[0,1],pre:0,prealloc:1,preserv:0,prevent:[0,1,3],primal:0,process:[0,2,3],program:6,propag:[0,6],properti:3,propog:3,proport:0,provid:[0,1,2,3,7],qualifi:7,question:0,rand:0,rather:0,reader:3,real:[1,3,6],realiti:[0,3],realli:4,reason:0,rebuild:0,recomend:1,reduc:[0,1],redund:0,refer:[6,7],rehash:3,reimplement:7,relev:[0,2],reli:0,remain:0,remaind:0,replac:2,repositori:2,repres:3,request:4,requir:[0,1,2,4],reshap:[0,7],resolv:2,resourc:4,ret:0,retriev:[0,4],reus:1,revel:4,revelslubinpapamarkou2016:4,revolv:2,roadblock:6,rosenbrock:0,rule:[2,3,6],run:[0,2,6],runtim:[0,6],sacrif:0,safe:0,sai:0,sake:1,same:2,scope:0,scroll:2,second:[0,1,3],section:[1,2],see:[0,1,2,6,7],seed:[1,3],seen:[0,6],select:[0,1],sensit:0,set:[0,4],sever:[0,1],shape:[0,1],share:2,should:[0,2],show:0,signatur:6,similar:[0,3],simpl:3,simpli:5,sin:[2,3],sinc:[0,7],singl:6,slpvectorizerpass:0,smaller:0,some:[0,2,6,7],sourc:0,special:2,specif:[0,1,6],specifi:1,speed:4,speedup:0,sqrt:2,squar:0,src:[0,2],sret:0,stabil:0,stabl:0,start:0,state:0,storag:[1,6],store:[0,1,3],struct:3,style:6,submit:2,substanti:2,subtyp:6,suit:[0,2],suitabl:2,support:[0,2,3,5,6,7],sure:2,swoop:0,symbol:2,system:0,tag:[0,3],take:[0,1,3,4,7],tan:2,target:[0,1,3,6],task:0,techniqu:[0,4,6],tensor:[0,7],term:3,test:2,than:0,thei:2,them:[1,3,7],thi:[0,1,2,3,4,6,7],thing:0,third:3,though:1,through:[2,6],thu:[0,3,6,7],time:0,titl:[2,4],top:0,transform:7,tune:0,tutori:2,two:[0,2,3],type:0,undefin:0,understand:3,unexport:4,unstabl:0,upgrade:4,url:4,usag:1,use:1,user:[0,1,3,4,6,7],usual:0,usualli:0,util:0,vari:4,variabl:0,vector_hessian:0,version:[0,4],via:0,wai:[0,2,3],want:0,well:[0,3,6],what:[0,2],whatev:2,when:[0,1,2],where:[0,1,3],wherea:0,whether:0,which:[0,1,2,3],wikipedia:4,wish:2,within:[3,6],without:[0,2,3],won:3,word:0,work:[0,1,2],workflow:2,would:[0,3],write:[0,2],written:6,year:4,yield:0,you:[0,1,2,4,7],your:[0,2,4,6],yourself:[1,2],zero:0},titles:["Advanced Usage Guide","Basic ForwardDiff API","How to Contribute","How ForwardDiff Works","ForwardDiff.jl","Installation and Version Requirements","Limitations of ForwardDiff","Upgrading from Older Versions of ForwardDiff"],titleterms:{"function":[0,2,7],"new":2,"public":4,"return":0,abstractconfig:1,access:0,adding:2,advanc:0,api:[1,3,7],basic:1,calculu:2,chunk:[0,7],configur:0,contribut:2,creat:7,deriv:1,differenti:7,dual:3,enabl:7,fix:0,forwarddiff:[1,2,3,4,6,7],from:7,gradient:1,guid:0,hessian:[0,1],higher:7,how:[2,3],implement:[2,3],inf:0,installat:5,issu:0,jacobian:1,limit:6,lower:[0,7],manual:2,multithread:7,nan:0,number:3,older:7,optimiz:2,order:[0,7],requir:5,result:[0,7],retriev:7,set:7,simd:0,size:[0,7],type:1,unari:2,unexport:7,upgrade:7,usage:0,valu:0,vector:0,version:[5,7],via:2,work:3}}) \ No newline at end of file