API
API for TaylorDiff.
TaylorDiff.TaylorArray — Type
TaylorArray{T, N, A, P}Representation of Taylor polynomials in array mode.
Fields
value::A: zeroth order coefficientpartials::NTuple{P, A}: i-th element of this stores the i-th derivative
TaylorDiff.TaylorScalar — Type
TaylorScalar{T, P}Representation of Taylor polynomials.
Fields
value::T: zeroth order coefficientpartials::NTuple{P, T}: i-th element of this stores the i-th derivative
TaylorDiff.TaylorScalar — Method
TaylorScalar{P}(value::T, seed::T)Convenience function: construct a Taylor polynomial with zeroth and first order coefficient, acting as a seed.
TaylorDiff.TaylorScalar — Method
TaylorScalar{P}(value::T) where {T, P}Convenience function: construct a Taylor polynomial with zeroth order coefficient.
TaylorDiff.can_taylorize — Method
TaylorDiff.can_taylorize(V::Type)Determines whether the type V is allowed as the scalar type in a Dual. By default, only <:Number types are allowed.
TaylorDiff.derivative — Function
derivative(f, x, ::Val{P})
derivative(f, x, l, ::Val{P})
derivative(f!, y, x, l, ::Val{P})Computes P-th directional derivative of f w.r.t. vector x in direction l. If x is a Number, the direction l can be omitted.
TaylorDiff.derivative! — Function
derivative!(result, f, x, l, ::Val{P})
derivative!(result, f!, y, x, l, ::Val{P})In-place derivative calculation APIs. result is expected to be pre-allocated and have the same shape as y.
TaylorDiff.derivatives — Function
derivatives(f, x, l, ::Val{P})
derivatives(f!, y, x, l, ::Val{P})Computes all derivatives of f at x up to order P.
TaylorDiff.get_term_raiser — Method
get_term_raiser(func)Return the derivative of func as an expression in z, together with the strategy for raising it to higher orders: if the derivative is inv(term) or 1 / term (possibly negated), term (respectively -term) is raised with the division rule raiseinv; otherwise the derivative is raised with the multiplication rule raise.
The expression is evaluated on Taylor series, so it must equal the derivative as a function (not only numerically) and must not branch on values. Such expressions are taken from DiffRules, whose rules are value-free expressions by design (unlike ChainRules' rules, which are only meant to be evaluated on numbers).
TaylorDiff.@immutable — Macro
immutable(def)Transform a function definition to a @generated function.
- Allocations are removed by replacing the output with scalar variables;
- Loops are unrolled;
- Indices are modified to use 1-based indexing;