(28 48 49 50) Bernoulli Numbers
|
09-05-2023, 05:27 PM
(This post was last modified: 09-10-2023 07:55 PM by John Keith.)
Post: #1
|
|||
|
|||
(28 48 49 50) Bernoulli Numbers
Note:The programs in this post return Bernoulli numbers as approximate (real) numbers. In post #6 below is a program for the HP-28 and HP-48 that returns the exact numerator and denominator for all m <= 28. Post #12 below has Exact mode programs for the HP 49/50 which are significantly faster than IBERNOULLI.
Given an integer n on the stack, this program returns the nth Bernoulli number as a real number. The result is accurate to 12 digits for numbers up to B(18) and to 11 or 12 digits up to B(40). The largest error is 5 ULP's for B(20), all others are 2 ULP's or less. The program has not been tested for n > 40 but larger Bernoulli numbers are > 10^16 and thus not very useful in most cases. This program grew out of the discussion in this thread and is based on this section of the Wikipedia page. Code:
This next program returns a list of Bernoulli numbers from 0 through n. The value of n is constrained to be an even number >= 4 in order to avoid making a large program even larger. For the HP-28, remove the NEWOB in line 9. Code:
|
|||
« 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: 2 Guest(s)