R / ADR Server

Input

Differentiate







Output

R/ADR Version 2.0.264

R code differentiated with automatic differentiation. Here you can differentiate R functions interactively. The differentiated codes are shown in the Output textarea above.

With the ADR package you can differentiate R functions automatically:

Then run:

Either command will send the function definition to this server form and then run the resulting differentiated code.

R features and functions supported by ADR

This is the list of R language features and functions that are supported by ADR. The elements listed here may be used in the user code, depending on the AD method, as shown by the letters F, R, H, and D:

LetterRemark
Fforward mode with adrDiffFor
Rreverse mode with adrDiffRev
Hforward-over-reverse mode with adrHessRev
Dfinite differences with adrDiffFD or adrHessFD

Language features

ModesRemark
ifF R H D incl. if expressions
forF R H D
whileF R H D
breakF R H D
nextF R H D
function callsF R H D incl. recursive
named argumentsF D
default parametersF D
function handlesF R H D e.g. after myfun <- sin will differentiate myfun correctly

Data types

ModesRemark
numericF R H D
complexF R H D forward and reverse mode may return different imaginary parts, namely the LHS and RHS of the second Cauchy-Riemann equation
arrayF R H D
MatrixF R H D
listF R H D not as independent var. or function result

Functions

The list of common R functions that can be differentiated with ADR. In most cases you can add support for any missing function f by providing a function df_f in your scope. For the reverse mode, you have to provide rec_f, a_f, and ret_f.

In the remaining cases ADR will deparse the function f and send the code to the ADR server. Hopefully the differentiated code will then be able to provide the correct derivative.

ModesRemark
ConjF R H D
ImF R H D
ReF R H D
absF R H D
acosF R D
acoshF R D
apermF R H D
appendF R D
arrayF R D
asinF R D
asinhF R D
atanF R D
atan2F D
atanhF R D
cF R H D
cbindF R H D
colMeansF R H D R: dims=1
colSumsF R H D R: dims=1
colnamesF R H D
colnames<-F R H D
convolveF R H D R,H: type='open' only
cosF R H D
coshF R D
diagF R D
diffF R D
dimF R H D
dim<-F R H D
dimnamesF R H D
dimnames<-F R H D
dnormF R H D
do.callF R D
expF R D
fftF R H D
is.arrayF R H D
is.complexF R D cannot be overloaded, for H use !is.numeric
is.doubleF R H D
is.functionF R H D
is.listF R H D
is.matrixF R H D
is.nullF R H D
is.numericF R H D
kroneckerF R D
lapplyF R D
lengthF R H D
listF R H D
logF R D
mvfftF R H D
namesF R H D
names<-F R H D
normF R H D norm(,"2") only
pmaxF D
pminF D
pnormF R H D
qrF R D
qr.QF R D
qr.RF R D
qr.qtyF D
qr.qyF D
rangeF R D
rbindF R H D
repF R H D
rep.intF R D
revF R D
rownamesF R H D
rownames<-F R H D
sinF R H D
sinhF R D
solveF R D
sqrtF R H D
sumF R H D
svdF R D Derivative of the singular values only, as of yet
tF R H D
tanF R H D
tanhF R D