Theoretica
A C++ numerical and automatic mathematical library
theoretica::taylor Namespace Reference

Taylor series expansions. More...

Functions

template<typename DualFunction >
polynomial< realexpand_linear (DualFunction f, real x0=0)
 Computes the first order Taylor expansion of a generic function around x0, computed using dual numbers. More...
 
template<typename Dual2Function >
polynomial< realexpand_quadratic (Dual2Function f, real x0=0)
 Computes the second order Taylor expansion of a generic function around x0, computed using dual numbers (of second order). More...
 

Detailed Description

Taylor series expansions.

Function Documentation

◆ expand_linear()

template<typename DualFunction >
polynomial<real> theoretica::taylor::expand_linear ( DualFunction  f,
real  x0 = 0 
)
inline

Computes the first order Taylor expansion of a generic function around x0, computed using dual numbers.

Automatic differentiation is used to compute the exact values of the function and its derivatives at x0.

Parameters
fA function taking and returning a dual number, representing the function to expand in series.
x0The center of the Taylor expansion
Returns
The Taylor series expansion of the function to first degree

◆ expand_quadratic()

template<typename Dual2Function >
polynomial<real> theoretica::taylor::expand_quadratic ( Dual2Function  f,
real  x0 = 0 
)
inline

Computes the second order Taylor expansion of a generic function around x0, computed using dual numbers (of second order).

Automatic differentiation is used to compute the exact values of the function and its derivatives at x0.

Parameters
fA function taking and returning a dual2 number, representing the function to expand in series.
x0The center of the Taylor expansion
Returns
The Taylor series expansion of the function to second degree