However, it turns out that the 89/92+ are extremely slow to find the dimension of lists with large
elements, even if the lists have few elements. For example, if the bpoly[] has 70 polynomials, its size is
about 24000 bytes, and
dim(spfn\bpoly) takes over 30 seconds to return the dimension of 70! If
bpoly[] has 100 elements,
dim(bpoly) takes 5 seconds to fail with a "Memory" error message.
This explains the long delay when bnpoly() is used to add polynomials to lists that are already of high
order.
One potential work-around to this problem would be to use the
try...else...endtry condtional test
to trap the error, but functions cannot use
try...endtry!
So, rather than do a proper test for a valid input argument, I accept that fact that bpo() will not fail
gracefully, in return for fast execution times for proper arguments.
For more information on Bernoulli numbers and polynomials, these references may be helpful:
Handbook of Mathematical Functions, Milton Abramowitz and Irene A. Stegun, Dover, 1965. This
reference defines the Bernoulli numbers and polynomials, has a very complete table of properties, and
also tables of the polynomials and numbers. Various applications are shown throughout the book
where relevant.
Numerical Methods for Scientists and Engineers, R.W. Hamming, Dover, 1962. Hamming shows
another method to generate the Bernoulli numbers using a summation (p190).
Ada and the first computer, Eugene Eric Kim and Betty Alexandra Toole, Scientific American
magazine, May 1999. This very interesting article describes a program written in 1843, by Ada,
countess of Lovelace, for Charles Babbage's Analytical Engine. The purpose of the program was to
calculate the Bernoulli numbers. The analytical engine, a mechanical computer, was never completed,
as the British government didn't fund it adequately, and Babbage kept revising the design.
These web sites are also interesting:
http://www.treasure-troves.com/math/BernoulliNumber.html
This site describes the derivation and basic properties of the Bernoulli numbers and polynomials.
http://venus.mathsoft.com/asolve/constant/apery/brnlli.html
This site shows the expression for the tangent function, as a function of the Bernoulli number.
http://www-history.mcs.st-andrews.ac.uk/~history/Mathematicians/Bernoulli_Jacob.html
This site has a very nice biography of Jacob Bernoulli, who was the particular Bernoulli responsible for
the Bernoulli numbers and polynomials.
[6.28] Bilinear interpolation
Tip [6.22] shows how to do linear interpolation in two dimensions, that is, to estimate y = f(x), given two
points. This basic concept can be extended to three dimensions, in that we want to estimate z = f(x,y).
In this tip, I show two methods two interpolate in three dimensions. The first method, called bilinear
interpolation, requires four (x,y,z) points and performs a linear interpolation. The second method, which
I call 9-point interpolation, requires nine (x,y,z) points, but fits the data to a general second-order
polynomial in x and y. This method is slower, but more accurate.
6 - 44