FFT Multiplication (HP-48G/GX/G+)
02-11-2014, 10:48 PM
Post: #6
 Gerson W. Barbosa Senior Member Posts: 1,199 Joined: Dec 2013
RE: FFT Multiplication (HP-48G/GX/G+)
(02-11-2014 09:22 PM)Christoph Giesselink Wrote:  I agree with Raymond, that using other data types improves the speed significantly.

But what about using SystemRPL? Using SystemRPL throwing away the OOP overhead and protection stuff improving also the execution speed. It's never too late to learn SystemRPL. ;-)

Hey, I like that one, "It's never too late to learn XXXX". Much better than "Life is too short to learn German" (who said that?) :-)
I regret never having tried to learn Saturn Assembly or SysRPL back in the day. Now that the HP-48 has been discontinued and the HP-50g is fast enough I don't feel motivated. But I have a notion of what I missed...
Sticking to User-RPL I have started to rewrite the program following Raymond's advice. Indeed the delay is due to switching to and from lists and vectors. FFT on the HP-48GX takes about 1/6 of the time it takes FOUR on the HP-71B, exactly what one should expect just considering the clock rates of both devices. I've only just begun and running time has dropped from 200 to 175 seconds for 256-digit multiplications. The final array to vector conversion alone takes 15 seconds:

Code:
 %%HP: T(3)A(D)F(,); \<< DUP2 SIZE OBJ\-> DROP SWAP SIZE OBJ\-> DROP DUP2 MAX ROT ROT + 4 ROLLD LN 2 LN / DUP FP NOT NOT SWAP IP + 2 SWAP ^ DUP + DUP ROT SWAP 1 \->LIST RDM ROT ROT 1 \->LIST RDM FFT OBJ\-> 1 GET \->LIST SWAP 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 OBJ\-> 1 \->LIST \->ARRY \>>

I wasn't aware there was an array re-dimension command, RDM. Sometimes is pays to read the manual :-)

(02-11-2014 09:22 PM)Christoph Giesselink Wrote:  Moreover, without SystemRPL we may not have emulators like Emu28, Emu42 and Emu71/Win. I began working on Emu48 in 1997 because I wrote SystemRPL programs since 1995 and tested them on my real HP48SX. After each of such a debugging session I always had to restore the memory content. With Kermit this took ~30 minutes. So I was looking for a simple way to restore data quickly. The problem was, that Emu48 0.99 and Emu48 1.0 wasn't working very well on Windows NT4, the story began...

I should thank you again for all those emulators, especially Emu48. Too used to RPN, I would make mistakes all the time when using the Windows calculator at work. I even started to write an RPN calculators in Delphi (my only attempt at the language) and almost succeeded, only the EEX key was left not implemented. But then I found Emu48 which became my only calculator on the PC :-)

Best regards,

Gerson.
 « 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)