Post Reply 
(28/48/50) Complete Elliptic Integrals
03-14-2024, 07:16 PM
Post: #17
RE: (28/48/50) Complete Elliptic Integrals
Here are four short programs to compute the derivatives of the elliptic integrals at k. For references see the Wikipedia pages here and here.

The programs dKk, dEk and dNOME require k on the stack. dΠdk requires the numbers n on level 2 and k on level 1. I am listing the programs as a directory here, and they need to be in the path of the programs in post #1, several of which are called by these programs.

Code:

DIR
  dKk
  \<< 1 OVER SQ - OVER EKk 3 PICK * - ROT ROT * /
  \>>
  dEk
  \<< DUP EKk - SWAP /
  \>>
  d\PIdk
  \<<
    IF OVER ABS
    THEN DUP2 \PInk ROT ROT DUP EKk DROP
      OVER SQ 1 - /
      4 ROLL + OVER *
      ROT ROT SQ - /
    ELSE SWAP DROP dKk
    END
  \>>
  dNOME
  \<< DUP ENOME \pi SQ \->NUM *
      SWAP 1 OVER SQ - OVER Kk SQ
      ROT 2 * * * /
  \>>
END

And again, the same programs optimized for the HP 49 and 50.

Code:

DIR
  dKk
  \<< 1. OVER SQ - OVER EKk PICK3 * - UNROT * /
  \>>
  dEk
  \<< DUP EKk - SWAP /
  \>>
  d\PIdk
  \<<
    IF OVER ABS
    THEN DUP2 \PInk UNROT DUP EKk DROP
      OVER SQ 1. - /
      4. ROLL + OVER *
      UNROT SQ - /
    ELSE NIP dKk
    END
  \>>
  dNOME
  \<< DUP ENOME \pi SQ \->NUM *
      SWAP 1. OVER SQ - OVER Kk SQ
      ROT 2. * * * /
  \>>
END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (28/48/50) Complete Elliptic Integrals - John Keith - 03-14-2024 07:16 PM



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