dualnumbers

This module contains the Dual type, which is used to represent dual numbers, along with related mathematical operations and functions.

The intention of the this module is to provide a dual number type, which can be used for automatic differentation. This means you can calculate with it the same way you would with floating point numbers. The real part will be identically to the result of a calculation with floating point numbers. Comparison operations (opCmp) ignore the value of the dual part.

To calculate the derivate with respect to a variable, set the dual part of this variable to 1. All other dual parts should be 0. After the calculation the dual part contains the derivate.

Members

Functions

abs
Dual!T abs(Dual!T x)

Abs function on dual numbers.

cos
Dual!T cos(Dual!T x)

Cosinus function on dual numbers.

dual
auto dual(const R re)
auto dual(const R re, const D du)

Helper function that returns a dual number with the specified real and dual parts.

exp
Dual!T exp(Dual!T x)

Exponential function on dual numbers.

sin
Dual!T sin(Dual!T x)

Sinus function on dual numbers.

Structs

Dual
struct Dual(T)

Dual number for automatic differentation

See Also

Meta

Authors

René Heldmaier and others (see individual files)