HP50g simplifing a root
10-05-2020, 11:36 AM
Post: #12
 peacecalc Member Posts: 205 Joined: Dec 2013
RE: HP50g simplifing a root
Hello Albert,

thank you for critics. Of course I forgot to implement the testing procedure being shure that I found a correct solution! The checking is absolut necessary.

Code:
 « \-> E   « E 3 ^ DUP 'E' STO OBJ-> ->STR     IF "+" ==     THEN 1     ELSE -1     END SWAP DROP SWAP OBJ-> DROP2 DUP 2 ^ EVAL \-> A SG B RT K     « A DIVIS SORT \-> L       « A L 3 ^ -         «  \-> B           «             IF B 0 >             THEN B             END           »         » DOLIST          \-> L3         « L 1.0000 L3 SIZE SUB 'L' STO L3 L / 3 K * / \SQRT 'L3' STO            L3           «  \-> B             « B TYPE               IF 28.0000 ==               THEN B               ELSE 0               END             »           » DOLIST            'L3' STO { }                       1.0000 L3 SIZE           FOR I L3 I GET DUP             IF 0 ‹             THEN + I +             ELSE DROP             END           NEXT 'L3' STO                      IF L3 { } <>           THEN              1.0000 L3 SIZE             FOR I               L3 I GET               L L3 I 1.0000 + GET GET               \-> a b               «                 B b 2 ^ K * a  2 ^ 3 * + b *                 IF ==                 THEN a b SG RT * * + EVAL                 ELSE E 3 INV ^ EVAL                  END              »                      2.0000 STEP           ELSE E 3 INV ^ EVAL           END         »       »     »   » »

Code is corrected, now the program tests if the found "a" leads to B as input.
 « Next Oldest | Next Newest »

 Messages In This Thread HP50g simplifing a root - peacecalc - 09-29-2020, 09:22 PM RE: HP50g simplifing a root - Albert Chan - 09-29-2020, 11:47 PM RE: HP50g simplifing a root - Albert Chan - 09-30-2020, 02:22 AM RE: HP50g simplifing a root - Albert Chan - 09-30-2020, 10:50 PM RE: HP50g simplifing a root - Albert Chan - 10-01-2020, 07:31 AM RE: HP50g simplifing a root - peacecalc - 09-30-2020, 05:33 AM RE: HP50g simplifing a root - peacecalc - 10-01-2020, 02:20 PM RE: HP50g simplifing a root - Albert Chan - 10-01-2020, 05:22 PM RE: HP50g simplifing a root - peacecalc - 10-04-2020, 06:05 PM RE: HP50g simplifing a root - Albert Chan - 10-04-2020, 11:48 PM RE: HP50g simplifing a root - peacecalc - 10-04-2020, 07:36 PM RE: HP50g simplifing a root - peacecalc - 10-05-2020 11:36 AM RE: HP50g simplifing a root - Albert Chan - 10-05-2020, 05:01 PM RE: HP50g simplifing a root - peacecalc - 10-06-2020, 05:25 AM RE: HP50g simplifing a root - Albert Chan - 10-06-2020, 09:40 AM RE: HP50g simplifing a root - Albert Chan - 10-06-2020, 12:06 PM RE: HP50g simplifing a root - Albert Chan - 10-06-2020, 04:13 PM RE: HP50g simplifing a root - Albert Chan - 10-07-2020, 06:12 PM RE: HP50g simplifing a root - Albert Chan - 10-09-2020, 12:20 AM RE: HP50g simplifing a root - Albert Chan - 10-09-2020, 02:31 PM RE: HP50g simplifing a root - Albert Chan - 10-11-2020, 06:28 PM RE: HP50g simplifing a root - Albert Chan - 10-12-2020, 03:17 AM RE: HP50g simplifing a root - Albert Chan - 10-24-2020, 02:19 PM RE: HP50g simplifing a root - Albert Chan - 10-12-2020, 10:54 PM RE: HP50g simplifing a root - CMarangon - 10-12-2020, 11:45 PM RE: HP50g simplifing a root - grsbanks - 10-13-2020, 06:46 AM RE: HP50g simplifing a root - Albert Chan - 10-09-2020, 05:21 PM RE: HP50g simplifing a root - Albert Chan - 10-10-2020, 03:58 PM RE: HP50g simplifing a root - Albert Chan - 10-10-2020, 04:49 PM RE: HP50g simplifing a root - peacecalc - 10-12-2020, 08:49 PM RE: HP50g simplifing a root - peacecalc - 10-13-2020, 06:30 AM RE: HP50g simplifing a root - peacecalc - 10-13-2020, 06:36 AM

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