04-03-2019, 05:27 PM
Programs for the INVERT transform and its inverse.
First, the INVERT transform: Explanation of the algorithm here.
Next, the INVERTi transform, the inverse of the INVERT transform. Explained here.
For HP-48G compatibility, replace PICK3 with 3 PICK and replace NIP with SWAP DROP.
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. 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.