Post Reply 
Quadratic Solver for Casio FX-3650P
07-18-2018, 04:35 PM (This post was last modified: 11-22-2018 01:32 PM by Albert Chan.)
Post: #3
RE: Quadratic Solver for Casio FX-3650P
Using Thomas Klemm idea about coefficient reduction, my Quadratic Solver can now handle harder Quadratic.
http://www.hpmuseum.org/forum/thread-2181.html

For quadratic with a hard time getting good value of discriminant B^2 - 4AC
Transform Quadratic F(z) with offset k, so z = y + k:

F(z) = A z^2 + B z + C
= A(y^2 + 2ky + k^2) + B(y + k) + C
= A y^2 + (2kA + B) y + (A k^2 + B k + C)
= A y^2 + F'(k) y + F(k)
= G(y)

To reduce the G(y) coefficient F'(k) ~ 0, k ~ -B/(2A)
After solving G(y) = 0 for y, z = y + k, and we are done

To automate above, I made another program for F(z) / (z - X)
Each coefficient entry showed the coefficient of F(z) / (z - X)
After finished entering the coefficients, B = F'(X), C = F(X)

Since the program calculated F'(X) and F(X), it also does Newtons method.
If X=0, the program assumed I wanted Newton improved X, based on previous results.

Synthetic Division program listing (59 keys):

Code:
? -> X : X=0 => Y - C/B -> X PAUSE -- Newton correction
X -> Y : 0 -> B : ? -> A : A -> D :

LBL 1 : D -> C : ? -> C : -- Horner's Method: F(z) / (z - X)
BX + D -> B : -- F'(X)
DX + C -> D : -- F(X)
GOTO 1 :       -- Key AC to stop

Borrowing Klemm example, solve F(z) = 11713 z^2 - 1470492 z + 46152709 = 0

Just by looking at the coefficients, my Casio cannot give exact B^2 - 4AC
So, try reduction with offset X ~ -B/(2A) = 62.77179203

We wanted the *exact* transformed G(y), so pick X = 63
Running above program, we get:

Synthetic Division Program:
? X -- 63 enter
? A -- 11713 enter
? C -- -1470492 enter
? C -- 46152709 enter AC (to stop)

--> A = 11713, B = 5346, C = 610
--> Now, solve G(y) = 11713 y^2 + 5346 y + 610 = 0

Quadratic Solver Program:
? A -- enter
? B -- enter
? C -- enter
MATH ERROR -- complex roots = X +/- Y i

--> G(y) roots = -0.228207974 +/- 8.537522411e-05 i
--> F(z) roots = 62.771792026 +/- 8.537522411e-05 i
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Quadratic Solver for Casio FX-3650P - Albert Chan - 07-18-2018 04:35 PM



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