04-05-2021, 10:53 AM
(11C/15C) Extended power function
Hi,
A long time ago, I had to solve some equations like
f(t) = 2 + XROOT(3, (1 - 5t)) = 0
where XROOT(3, -8)=-2
But the HP15C (or the HP11C) could not handle -8^(1/3) without returning ERROR 0, out of the complex mode
So, I composed a function to compute Y^X with Y and X as decimal or natural numbers
It gave the following program for the HP15C
(The program also runs on the HP11C by using CF 0, SF 0 or F?0 instead of CF 8, SF 8 and F?8)
With this usage :
-8
ENTER
3 1/x
GSB E
returns -2
Further, A is the function to solve
So, 0 ENTER 0
f SOLVE A returns 1.8 after running near a minute
Keep you safe !
Hi,
A long time ago, I had to solve some equations like
f(t) = 2 + XROOT(3, (1 - 5t)) = 0
where XROOT(3, -8)=-2
But the HP15C (or the HP11C) could not handle -8^(1/3) without returning ERROR 0, out of the complex mode
So, I composed a function to compute Y^X with Y and X as decimal or natural numbers
It gave the following program for the HP15C
(The program also runs on the HP11C by using CF 0, SF 0 or F?0 instead of CF 8, SF 8 and F?8)
Code:
f LBL E
ENTER
g INT
x=y (5)
GTO .9
g CLx
g LSTx
f FRAC
1/x
g RND
g CF 8
2
÷
f FRAC
g x=0
GTO .9
g SF 8
R↓
x↔y
x>0 (1)
g CF 8
g ABS
g LN
x
e^x
g F? 8
CHS
g CF 8
g RTN
f LBL .9
R↓
y^x
g RTN
f LBA A
5
CHS
x
1
+
3
1/x
GSB E // calls extended Y^X
2
+
g RTN
With this usage :
-8
ENTER
3 1/x
GSB E
returns -2
Further, A is the function to solve
So, 0 ENTER 0
f SOLVE A returns 1.8 after running near a minute
Keep you safe !