Post Reply 
Automatic differentiation using dual numbers
06-18-2022, 08:32 PM
Post: #5
RE: Automatic differentiation using dual numbers
Meanwhile, I remembered an earlier thread: Derivatives on HP 42S.
The Complex-Step Derivative Approximation only works for analytic functions.
And as the name suggests, it is an approximation.

The main advantage is that cancellation is avoided compared to the classical finite-difference approximations.
Implementation is easy if the functions and operations are overloaded for complex values.
This is the case with the HP-15C and HP-42S.

Here in automatic differentiation, complex numbers are used primarily as a structure to keep track of the values ​​of \(f(x)\) and \(f'(x)\).
The complex variants of the functions are not used.

In addition, the functions do not have to be analytical.
But they should be differentiable.

We can even define ABS :

\(
\left| \left< u, {u}' \right>\right| = \left< \left| u \right|, {u}' \, \text{sign}(u)\right> \; (u \ne 0)
\)

Thus you can program your own variant of a 3ROOT function and its derivative.

With automatic differentiation, the value of the derivative is exact.
Of course, rounding errors can also occur.
However, these do not depend on an arbitrarily small increment such as \(h = 10^{-5}\).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Automatic differentiation using dual numbers - Thomas Klemm - 06-18-2022 08:32 PM
Fixed Point Iteration - Thomas Klemm - 06-19-2022, 08:31 PM



User(s) browsing this thread: 3 Guest(s)