Post Reply 
Automatic differentiation using dual numbers
06-18-2022, 07:25 PM
Post: #3
RE: Automatic differentiation using dual numbers
To calculate an extremum we have to find solutions of \(f'(x) = 0\).

We can use the SOLVER with the program f'(x) for the example \(f(x) = x^3 - 2x^2 + 2\):
Code:
00 { 62-Byte Prgm }
01▸LBL "f'(x)"
02 MVAR "x"
03 RCL "x"
04 1
05 COMPLEX
06 STO "x"
07 XEQ "f(x)"
08 COMPLEX
09 STO "x"
10 RTN
11▸LBL "f(x)"
12 RCL "x"
13 2
14 -
15 RCL "x"
16 XEQ "X↑2"
17 XEQ "*"
18 2
19 +
20 END

SOLVER

Select Solve Program
f'(x)

1 x
x=1

2 x
x=2

x
1.333333333333333333333333333333333



I must admit that I don't fully understand the second part which involves \(\sqrt[3]{x}\).
As there is no built-in function we'd use:
Code:
RCL "x"
3
1/X
XEQ "Y↑X"

For negative values we'd have to use:
Code:
RCL "x"
+/-
3
1/X
XEQ "Y↑X"
+/-

Do you have a specific example in mind?
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 07:25 PM
Fixed Point Iteration - Thomas Klemm - 06-19-2022, 08:31 PM



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