HP Forums
(48G) 48G, 49G & 50G: Multiplicative Inverse of a Bint Modulo 2^20 - 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) 48G, 49G & 50G: Multiplicative Inverse of a Bint Modulo 2^20 (/thread-4384.html)



(48G) 48G, 49G & 50G: Multiplicative Inverse of a Bint Modulo 2^20 - Gerald H - 07-19-2015 06:22 PM

The title says it.

If you have a faster algorithm please say.

Code:

::
  CK1&Dispatch
  # 1F
  ::
    BINT1
    BINT19
    ZERO_DO
    OVER
    #*
    SWAPDUP
    #*
    SWAPLOOP
    SWAPDROP
  ;
;



RE: HP 48G, 49G & 50G: Multiplicative Inverse of a Bint Modulo 2^20 - Gerald H - 07-22-2015 05:03 AM

Carmichael

https://en.wikipedia.org/wiki/Carmichael_function

says we can simplify the algorithm to:

Code:

::
  CK1&Dispatch
  # 1F
  ::
    BINT1
    BINT18
    ZERO_DO
    OVER
    #*
    SWAPDUP
    #*
    SWAPLOOP
    SWAPDROP
  ;
;