The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]


WP 34S: Polynomial root finder adapted from Valentin Albillo's HP 41 program

Posted by Miguel Toro on 23 Nov 2011, 7:32 p.m.

Usage:

1. [XEQ][ENTER]'PRT' 2. Enter degree [R/S] 3. Enter coefficients: Imaginary part [ENTER] real part [R/S] note : if only real, enter the value and [R/S]

Resources:

Flags A, 01

Registers A: iterations limit r09-rNx2+10: coefficients and roots r00: root counter r01: index to coefficients / solutions r03-r04: auxiliary registers r05: index to the coefficients r07-r08: auxiliary registers

Labels 00,01,02,05,06,10,11,12

Comments: Works with WP34s ver. 3.2

Program:

001 LBL'PRT' 002 SSIZE4 003 FIX 00 004 CL[alpha] 005 [alpha]'N=?' 006 PROMPT 007 STO 00 008 STO 03 009 STO+ X 010 9 011 . 012 0 013 0 014 8 015 0 016 2 017 + 018 STO 01 019 STO 05 020 CLx 021 LBL 05 022 CL[alpha] 023 [alpha]'Im[^]' 024 [alpha]'Re[space]' 025 [alpha]IP 03 026 [alpha] ? 027 CLSTK 028 PROMPT 029 [cmplx]STO[->]05 030 DEC 03 031 DSE 05 032 GTO 05 033 RCL 03 034 LBL 06 035 4 036 SDL 002 037 STO A 038 x[<->] Y 039 CF A 040 +/- 041 STO 04 042 FIX 02 043 ROUND 044 FIX 11 045 x[!=]0? 046 GTO 01 047 1 048 STO 04 049 LBL 01 050 DSE A 051 SKIP 01 052 GTO 12 053 RCL 00 054 STO 08 055 SF 01 056 XEQ 11 057 [->]POL 058 1/x 059 STO 07 060 x[<->] Y 061 +/- 062 STO 08 063 CF 01 064 XEQ 11 065 [cmplx]RCL 07 066 [->]REC 067 [cmplx][times] 068 [cmplx]STO- 03 069 [cmplx]ROUND 070 [cmplx]x[!=]0? 071 GTO 01 072 SF A 073 XEQ 11 074 2 075 STO+ 05 076 SDR 003 077 STO+ 01 078 [cmplx]RCL 03 079 [cmplx]STO[->]05 080 x[<->] Y 081 DSE 00 082 GTO 06 083 RCL 01 084 IP 085 # 10 086 - 087 SDR 003 088 STO- 05 089 FIX 07 090 LBL 10 091 INC 00 092 CL[alpha] 093 [alpha]'Re[space]' 094 [alpha]IP 00 095 [cmplx]RCL[->]05 096 x[approx]0? 097 CLSTK 098 PROMPT 099 x[<->] Y 100 x[approx]0? 101 SKIP 04 102 CL[alpha] 103 [alpha]'Im[space]' 104 [alpha]IP 00 105 PROMPT 106 DSE 05 107 GTO 10 108 CLSTK 109 CF A 110 RTN 111 LBL 11 112 RCL 01 113 STO 05 114 FC? 01 115 GTO 13 116 EEX 117 3 118 +/- 119 ENTER[^] 120 2 121 [times] 122 STO+ 05 123 LBL 13 124 [cmplx]RCL[->]05 125 FC? 01 126 GTO 02 127 RCL 08 128 STO[times] Z 129 [times] 130 DSE 08 131 GTO 02 132 RTN 133 LBL 12 134 CL[alpha] 135 [alpha]'No[space]' 136 [alpha]'0s' 137 VIEW[alpha] 138 CLSTK 139 RTN 140 LBL 00 141 [cmplx]RCL 03 142 [cmplx][times] 143 RCL[->]05 144 FS? 01 145 RCL 08 146 FS? 01 147 [times] 148 + 149 FS? A 150 STO[->]05 151 x[<->] Y 152 INC 05 153 RCL[->]05 154 FS? 01 155 RCL 08 156 FS? 01 157 [times] 158 + 159 FS? A 160 STO[->]05 161 DEC 05 162 x[<->] Y 163 FS? 01 164 DSE 08 165 LBL 02 166 DSE 05 167 GTO 00 168 RTN 169 END

Edited: 30 Aug 2013, 3:54 p.m.

Password:

[ Return to the Message Index ]

Go back to the main exhibit hall