Post Reply 
(12C) X to Power of X Equation
02-18-2018, 01:41 PM (This post was last modified: 02-18-2018 02:06 PM by Dieter.)
Post: #2
RE: (12C) X to Power of X Equation
(02-18-2018 09:15 AM)Gamo Wrote:  Here is the approximation of the equation of X^X=Y
...
Not sure if I implement this the right way or not. Any change is very welcome.

OK then. First, line 06...12 and 13...19 are exactly the same. Then in line 20 you store something in R0, fill the stack with it and subtract R0 again. So this always yields zero and the following test is always true. ?!?

Here is a short version of your algorithm.

Code:
01 STO 1   // store approximation
02 X<>Y
03 LN
04 ENTER   // fill stack with ln Y
05 ENTER
06 ENTER
07 RCL 1   // start calculating new approximation
08 LN
09 /       // ln Y : LN X
10 RCL 1
11 +
12 2
13 /       // new approx. = (X + ln Y : lnX) : 2
14 STO 1   // store the result again
15 R/S
16 GTO 08  // and repeat

Enter Y and a first approximation:

f[PRGM]
1000 [ENTER] 4

[R/S] 4,491446
[R/S] 4,544975
[R/S] 4,553747
[R/S] 4,555231
[R/S] 4,555484
[R/S] 4,555527
[R/S] 4,555534
[R/S] 4,555535
[R/S] 4,555536
[R/S] 4,555536

Since your version always calculates two (!) successive approximations (twice the same code) the above results match every second one of yours.

You can also have an initial guess calculated by the program so that you only have to enter Y. This has been shown recently in the 11C version, on the 12C it can be done this way:

Code:
01 LN
02 STO 0
03 1
04 +
05 LN
06 ENTER
07 LN
08 0
09 x<=y?
10 X<>Y
11 X<>Y
12 R↓
13 -
14 e^x
15 R/S
16 ENTER
17 ENTER
18 ENTER
19 RCL 0
20 X<>Y
21 LN
22 /
23 +
24 2
25 /
26 GTO 15

f[PRGM]
1000
[R/S] 3,824155
[R/S] 4,487028
[R/S] 4,544273
[R/S] 4,553629
[R/S] 4,555211
[R/S] 4,555480
[R/S] 4,555526
[R/S] 4,555534
[R/S] 4,555535
[R/S] 4,555536
[R/S] 4,555536

When the new approximation is displayed you can press [X<>Y] to compare it with the previous one.

Now let's see if the iteration process can be done automatically. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) X to Power of X Equation - Gamo - 02-18-2018, 09:15 AM
RE: (12C) X to Power of X Equation - Dieter - 02-18-2018 01:41 PM



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