challenge HP50G RPL
|
09-24-2016, 01:04 PM
(This post was last modified: 09-26-2016 01:10 AM by compsystems.)
Post: #3
|
|||
|
|||
RE: challenge HP50G RPL
(09-24-2016 07:36 AM)Joe Horn Wrote: How about two instructions? « →V3 PROOT » 'QUADRATIC1' STO 1. -3. 2. QUADRATIC1 returns [1, 2] // ok 1. 2. 3. QUADRATIC1 returns [(-1.,1.41421356238) (-1., -1.41421356238)] // ok 'A' 'B' 'C' QUADRATIC1 returns "→V3 ERROR" =( with local vars & 8 instructions Code: « with 12 instructions Code: « /!\ First value, different from zero 1. -3. 2. QUADRATIC2 returns 1 2 // ok 1. 2. 3. QUADRATIC2 returns (-1.,1.41421356238) (-1., -1.41421356238) // ok (1,0) (-1,-1) (0,1) QUADRATIC2 returns (1, 0) (0, 1) 'a' 'b' 'c' QUADRATIC2 EVAL returns '(-b+√(c*-4.*a+SQ(b)))/(a*2.)' '(-b-√(c*-4.*a+SQ(b)))/(a*2.)' /!\ but the idea is to use the formula '-B±√(B^2-4*A*C)/2*A' with RPN commands (SWAP DUP ROLL ROLLD etc), also without unused local variables or globales and EVAL as in the first post with the code of firts post ... 'QUADRATIC' STO 1. -3. 2. QUADRATIC returns 1 2 // ok 1. 2. 3. QUADRATIC returns (-1.,1.41421356238) (-1., -1.41421356238) // ok (1,0) (-1,-1) (0,1) QUADRATIC returns (1, 0) (0, 1) 'a' 'b' 'c' QUADRATIC returns '(-b+√(c*-4.*a+SQ(b)))/(a*2.)' '(-b-√(c*-4.*a+SQ(b)))/(a*2.)' PD: Someone who can port it to RPN HP-PRIME Thanks |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
challenge HP50G RPL - compsystems - 09-24-2016, 04:02 AM
RE: challenge HP50G RPL - Joe Horn - 09-24-2016, 07:36 AM
RE: challenge HP50G RPL - compsystems - 09-24-2016 01:04 PM
RE: challenge HP50G RPL - Gerson W. Barbosa - 09-24-2016, 05:15 PM
RE: challenge HP50G RPL - Juan14 - 09-26-2016, 12:46 AM
RE: challenge HP50G RPL - Gerson W. Barbosa - 09-26-2016, 01:51 AM
RE: challenge HP50G RPL - Juan14 - 09-26-2016, 11:56 PM
RE: challenge HP50G RPL - compsystems - 09-24-2016, 10:20 PM
RE: challenge HP50G RPL - peacecalc - 09-25-2016, 08:14 AM
RE: challenge HP50G RPL - compsystems - 09-25-2016, 03:40 PM
RE: challenge HP50G RPL - Gerson W. Barbosa - 09-25-2016, 05:03 PM
RE: challenge HP50G RPL - compsystems - 09-25-2016, 10:41 PM
RE: challenge HP50G RPL - compsystems - 10-05-2016, 12:28 AM
RE: challenge HP50G RPL - Gerson W. Barbosa - 10-05-2016, 04:13 PM
|
User(s) browsing this thread: 4 Guest(s)