Post Reply 
(28 48 49 50) Bernoulli Numbers
09-06-2023, 08:48 AM
Post: #2
RE: (48G) Bernoulli numbers
On a 50g this programme

Code:
Size: 277.

CkSum: # 1FA8h

::
  CK2&Dispatch
  # AFF
  ::
    FPTR2 ^DupQIsZero?
    case2drop
    ZINT 1
    FPTR2 ^DupZIsOne?
    case
    ::
      ZINT 2
      FPTR2 ^NDXFext
      FPTR2 ^QSub
      FPTR2 ^CASCOMPEVAL
    ;
    FPTR2 ^DupZIsEven?
    NOT
    3PICK
    CRUNCH
    %0=
    AND
    case2drop
    ZINT 0
    DUP
    ZINT 2
    FPTR2 ^RADDext
    3UNROLL
    FPTR2 ^Z2BIN
    ZINT 0
    ZINT 0
    ZINT -1
    4PICK
    #2+
    ONE_DO
    ZINT 1
    7PICK
    INDEX@
    FPTR2 ^#>Z
    FPTR2 ^QDiv
    FPTR2 ^QSub
    FPTR2 ^QMul
    FPTR2 ^CASCOMPEVAL
    5PICK
    5PICK
    FPTR2 ^PPow#
    ROT
    FPTR2 ^QAdd
    FPTR2 ^CASCOMPEVAL
    SWAP
    5ROLL
    ZINT 1
    FPTR2 ^QAdd
    5UNROLL
    2DUP
    FPTR2 ^QMul
    INDEX@
    FPTR2 ^#>Z
    FPTR2 ^QDiv
    4ROLL
    FPTR2 ^QAdd
    FPTR2 ^CASCOMPEVAL
    3UNROLL
    LOOP
    2DROP
    4UNROLL3DROP
  ;
;

for input

1
100

returns

'
-94598037819122125295227433069493721872702841533066936133385696204311395415197247​711
/33330'

in

42.2994s
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (48G) Bernoulli numbers - Gerald H - 09-06-2023 08:48 AM
RE: (48G) Bernoulli numbers - John Keith - 09-06-2023, 11:04 AM
RE: (48G) Bernoulli numbers - Gerald H - 09-06-2023, 02:34 PM
RE: (48G) Bernoulli numbers - Albert Chan - 09-07-2023, 03:37 PM
RE: (48G) Bernoulli numbers - John Keith - 09-07-2023, 04:18 PM
RE: (28 48) Bernoulli numbers - John Keith - 09-08-2023, 08:09 PM
RE: (28 48) Bernoulli numbers - John Keith - 09-10-2023, 03:24 PM
RE: (28 48) Bernoulli numbers - John Keith - 09-10-2023, 07:45 PM



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