Browse Prior Art Database

APL Algorithm to Generate Bernoulli Numbers

IP.com Disclosure Number: IPCOM000078011D
Original Publication Date: 1972-Oct-01
Included in the Prior Art Database: 2005-Feb-25
Document File: 2 page(s) / 31K

Publishing Venue

IBM

Related People

Reynolds, SW: AUTHOR [+2]

Abstract

A concise APL algorithm to generate the first N Bernoulli numbers by solving a set of about N/2 simultaneous equations.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 80% of the total text.

Page 1 of 2

APL Algorithm to Generate Bernoulli Numbers

A concise APL algorithm to generate the first N Bernoulli numbers by solving a set of about N/2 simultaneous equations.

The algorithm will generate the first N Bernoulli numbers. The algorithm is considered useful for the following reasons: The algorithm is faster than nonrecursive methods. For example, the calculation of the eighth Bernoulli number required 620 milliseconds using the new algorithm, as compared to over one hundred seconds using the nonrecursive method. The algorithm requires one line of code as compared to twenty-four lines of code for the nonrecursive method.

The accuracy decreases as N increases from about 10 significant figures at N=16 to 3 at N=40.

The mathematical statement of the problem is the solution of the matrix equation.

(Image Omitted)

Since the odd Bernoulli numbers beyond B1 are zero, the indicated rows and columns may be deleted, resulting in a square matrix of order about N/2. The left-hand matrix is constructed as follows for order N: A vector of integers from 1 to N, N >/- 1, is generated and reversed in order. The factorial vector corresponding to these integers is restructured into an N by N matrix. Successive rows are right shifted by amounts corresponding, respectively, to the integer vector 1 to N. The columns and rows corresponding to the odd Bernoulli numbers are then deleted. This matrix is the divisor for a scalar divide with a lower triangular logical matrix as the dividend....