Learn R Programming

salad (version 1.2)

MathFun: Mathematical functions

Description

various mathematical functions and methods

Usage

# S3 method for dual
exp(x)

# S3 method for dual expm1(x)

logNeper(x)

# S3 method for dual log(x, base = exp(1))

# S3 method for dual log10(x)

# S3 method for dual log2(x)

# S3 method for dual log1p(x)

# S3 method for dual sqrt(x)

# S3 method for dual cos(x)

# S3 method for dual sin(x)

# S3 method for dual tan(x)

# S3 method for dual cospi(x)

# S3 method for dual sinpi(x)

# S3 method for dual tanpi(x)

# S3 method for dual acos(x)

# S3 method for dual asin(x)

# S3 method for dual atan(x)

# S4 method for dual,dual atan2(y, x)

# S4 method for dual,numericOrArray atan2(y, x)

# S4 method for numericOrArray,dual atan2(y, x)

# S3 method for dual cosh(x)

# S3 method for dual sinh(x)

# S3 method for dual tanh(x)

# S3 method for dual acosh(x)

# S3 method for dual asinh(x)

# S3 method for dual atanh(x)

# S3 method for dual abs(x)

# S3 method for dual sign(x)

# S3 method for dual ceiling(x)

# S3 method for dual floor(x)

# S3 method for dual trunc(x, ...)

# S3 method for dual gamma(x)

# S3 method for dual lgamma(x)

# S3 method for dual digamma(x)

# S3 method for dual trigamma(x)

psigamma.dual(x, deriv = 0)

# S4 method for dual psigamma(x, deriv = 0)

# S4 method for dual,dual beta(a, b)

# S4 method for dual,numericOrArray beta(a, b)

# S4 method for numericOrArray,dual beta(a, b)

# S4 method for dual,dual lbeta(a, b)

# S4 method for dual,numericOrArray lbeta(a, b)

# S4 method for numericOrArray,dual lbeta(a, b)

factorial.dual(x)

lfactorial.dual(x)

# S4 method for dual,numeric choose(n, k)

# S4 method for dual,numeric lchoose(n, k)

Value

All functions return dual objects.

Arguments

x

function argument (dual or numeric object)

base

base to which log is computed

y

first argument of atan2 function (dual or numeric)

...

extra arguments to trunc (unused)

deriv

integer argument to psigamma

a, b

arguments of beta and lbeta (dual or nueumeric)

n

first argument of choose and lchoose (dual)

k

second argument of choose and lchoose (numeric)

Details

The derivative of `abs` is set to be the function `sign`, so its derivative in 0 is considered as null. You may want to redefine `abs` using `dualFun1` to get an undefined derivative.

Examples

Run this code
x <- dual(1)
y <- log(x)
y
d(y)

Run the code above in your browser using DataLab