FFT Multiplication (HP-48G/GX/G+)
02-10-2014, 10:02 PM (This post was last modified: 02-11-2014 08:16 AM by Gerson W. Barbosa.)
Post: #2
 Gerson W. Barbosa Senior Member Posts: 1,546 Joined: Dec 2013
RE: FFT Multiplication (HP-48G/GX/G+)
(02-10-2014 09:25 PM)Gerson W. Barbosa Wrote:  . My HP-48GX is about 50% slower than the HP-71B when multiplying two 512-digit numbers (173 seconds versus 117 seconds).

Two 256-digit numbers, actually, giving a 512-digit result. Sorry for the mistake.

(02-10-2014 09:25 PM)Gerson W. Barbosa Wrote:  However, I've found a discrepancy in this example:

{ 1234 5678 9012 } { 3456 7890 } FFTMULT -->

{ 426 7639 7023 2002 4680 }

This should be fixed by inserting the following instructions between RE and IP in the code above, at the end of the second line after the IFFT command:

Code:
 1 \<< .00005 + \>> DOSUBS

More tests have to be made, though.

P.S.: .05 is better. No problem with 640-digit results (128 groups of 5 digits, constants replaced with 100,000), at least for the few examples I tried.

P.P.S.: Replacing RE IP with RE 0 RND is even better. Actually that's what should've been done in the first place if somehow I hadn't mistaken IROUND with IP. Since the HP-48 built-in IFFTis more accurate than the implementation using FOUR on the HP-71B it is possible groups of 5 digits rather than 4 can be used for up to 1000-digit results. A few empirical tests, as described in the last page of Valentin's article, should be made before we can be sure, however. Here is the fixed code:

Code:
 %%HP: T(3)A(D)F(.); \<< DUP2 SIZE SWAP SIZE + ROT ROT DUP2 SIZE SWAP SIZE DUP2 MAX LN 2 LN / DUP FP NOT NOT SWAP IP + 2 SWAP ^ DUP + ROT OVER - NEG ROT ROT - NEG ROT ROT 1 SWAP   START 0 +   NEXT SWAP ROT 1 ROT   START 0 +   NEXT OBJ\-> 1 \->LIST \->ARRY FFT OBJ\-> 1 GET \->LIST SWAP OBJ\-> 1 \->LIST \->ARRY FFT OBJ\-> 1 GET \->LIST   \<< *   \>> DOLIST OBJ\-> 1 \->LIST \->ARRY IFFT OBJ\-> 1 GET \->LIST 1 ROT SUB RE 0 RND REVLIST DUP SIZE 1 - 1 SWAP   FOR i i GETI ROT ROT GETI SWAP DROP ROT OVER 10000 MOD + OVER 10000 / IP OVER 10000 / IP + SWAP 10000 MOD ROT DROP SWAP ROT ROT i SWAP PUTI ROT PUTI DROP   NEXT REVLIST \>>
 « Next Oldest | Next Newest »

 Messages In This Thread FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-10-2014, 09:25 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-10-2014 10:02 PM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-11-2014, 09:04 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-11-2014, 03:34 PM RE: FFT Multiplication (HP-48G/GX/G+) - Christoph Giesselink - 02-11-2014, 09:22 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-11-2014, 10:48 PM RE: FFT Multiplication (HP-48G/GX/G+) - Ángel Martin - 02-12-2014, 12:51 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-12-2014, 08:09 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-12-2014, 02:41 AM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-13-2014, 01:16 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-13-2014, 03:16 AM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-14-2014, 12:34 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-14-2014, 01:31 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-14-2014, 12:07 AM RE: FFT Multiplication (HP-48G/GX/G+) - Han - 02-12-2014, 07:09 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-12-2014, 07:38 PM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-14-2014, 10:37 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-15-2014, 01:22 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-15-2014, 08:26 PM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-15-2014, 09:41 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-15-2014, 10:19 PM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-15-2014, 11:23 PM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-15-2014, 11:53 PM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-16-2014, 01:51 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-16-2014, 02:25 AM RE: FFT Multiplication (HP-48G/GX/G+) - Raymond Del Tondo - 02-15-2014, 02:15 AM RE: FFT Multiplication (HP-48G/GX/G+) - Gerson W. Barbosa - 02-16-2014, 05:21 AM

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