HP Forums
(48G 49 50g) INVERT Transform - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (48G 49 50g) INVERT Transform (/thread-12735.html)



(48G 49 50g) INVERT Transform - John Keith - 04-03-2019 05:27 PM

Programs for the INVERT transform and its inverse.

First, the INVERT transform: Explanation of the algorithm here.

Code:

\<< DUP SIZE \-> n
  \<< 1 OVER HEAD 2. \->LIST 2. n
    FOR k OVER 1. k SUB REVLIST OVER * \GSLIST +
    NEXT NIP TAIL
  \>>
\>>

Next, the INVERTi transform, the inverse of the INVERT transform. Confused Explained here.

Code:

\<< DUP SIZE \-> n
  \<< 1 OVER 1. 2. SUB EVAL SWAP - 2. \->LIST 2. n 1. -
    FOR k OVER 1. k SUB REVLIST OVER * \GSLIST PICK3 k 1. + GET SWAP - +
    NEXT NIP
  \>>
\>>

For HP-48G compatibility, replace PICK3 with 3 PICK and replace NIP with SWAP DROP.