(28 48 49 50) Bernoulli Numbers
|
09-10-2023, 07:45 PM
(This post was last modified: 09-10-2023 07:49 PM by John Keith.)
Post: #12
|
|||
|
|||
RE: (28 48) Bernoulli numbers
Albert Chan's program (see post # 6 above) is incredibly fast for numbers up to B(28) but can't be used for larger numbers, even on the HP 49 and 50, because it requires floating-point numbers. However, it turns out that the method using tangent numbers ( see post # 1) is significantly faster than the IBERNOULLI function in the 49/50, and with exact integers can compute Bernoulli numbers as large as memory allows.
The following program, similar to the first program in post #1, computes the nth Bernoulli number. It is over 3 * as fast as IBERNOULLI for B(100). The program requires GoferLists and must be used in Exact mode. Code:
The next program, similar to the second program in post #1, returns a list of Bernoulli numbers from 0..n. It is about 8 * as fast as a loop using IBERNOULLI. Exact mode required. Code:
Additional program notes: Though ListExt is newer, more flexible and generally faster than GoferLists, I am using GoferLists here because the commands Scanr and Last make the programs shorter and more readable. No special code is necessary to determine the denominator because exact integer division automatically reduces fractions to lowest terms. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(28 48 49 50) Bernoulli Numbers - John Keith - 09-05-2023, 05:27 PM
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 - Albert Chan - 09-09-2023, 06:33 PM
RE: (28 48) Bernoulli numbers - Albert Chan - 09-09-2023, 07:34 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 - Albert Chan - 09-10-2023, 07:39 PM
RE: (28 48) Bernoulli numbers - John Keith - 09-10-2023 07:45 PM
RE: (28 48 49 50) Bernoulli Numbers - Gerald H - 09-17-2023, 02:32 PM
|
User(s) browsing this thread: 1 Guest(s)