(11C) CUBIC EQUATION
|
06-09-2018, 06:05 PM
(This post was last modified: 06-09-2018 07:14 PM by Dieter.)
Post: #6
|
|||
|
|||
RE: (11C) CUBIC EQUATION
(06-09-2018 12:54 PM)Dieter Wrote: Maybe I can post a program that calculates the solutions directly. This should be much faster. OK, here it is. This should run on various classic RPN HPs, including the 11C, 15C, 67/97, 41 and maybe others. Code: 001 LBL C The program determines the roots for ax³+bx²+cx+d. It uses the data registers 0...3. "COS-1" is the inverse cosine (cos–1). If you want to see the discriminant you may insert a PAUSE between line 041 and 042. Even on slow machines like the 11C or 67/97 the program should run within a few seconds. Usage: a [ENTER] b [ENTER] c [ENTER] d [C] => first real root - if three real roots exist: [R/S] => second root [R/S] => third root - if the other two roots are complex (conjugate): [R/S] => "imaginary part", real part Both parts can be reviewed with the [X<>Y] key. Examples: 2x³ + 3x² – 6x – 5 2 [ENTER] 3 [ENTER] 6 [CHS] [ENTER] 5 [CHS] [C] 1,5297 [R/S] –0,7022 [R/S] –2,3275 x³ + x² + x – 1 1 [ENTER] 1 [ENTER] 1 [ENTER] 1 [CHS] [C] 0,5437 [R/S] "1,1151" –0,7718 So the real root is at 0,5437 and the two others are –0,7718 ±1,1151 i. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)