POLPAK
Recursive Polynomials
POLPAK
is a FORTRAN90 library which
evaluates a variety of mathematical functions.
It includes routines to evaluate the
recursively defined polynomial families of
-
Bernoulli
-
Bernstein
-
Cardan
-
Charlier
-
Chebyshev
-
Euler
-
Gegenbauer
-
Hermite
-
Jacobi
-
Krawtchouk
-
Laguerre
-
Legendre
-
Meixner
-
Zernike
A variety of other polynomials and functions have been added.
In a few cases, the new recursive feature of FORTRAN90
has been used (but NOT for the factorial function!)
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
POLPAK is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version
Related Data and Programs:
BERNSTEIN_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Bernstein polynomials;
CHEBYSHEV_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Chebyshev polynomial and associated functions.
CLAUSEN,
a FORTRAN90 library which
evaluates a Chebyshev interpolant to the Clausen function Cl2(x).
CORDIC,
a FORTRAN90 library which
uses the CORDIC method to compute certain elementary functions.
FN,
a FORTRAN90 library which
evaluates elementary and special functions,
by Wayne Fullerton.
GEGENBAUER_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Gegenbauer polynomial and associated functions.
HERMITE_POLYNOMIAL,
a FORTRAN90 library which
evaluates the physicist's Hermite polynomial, the probabilist's Hermite polynomial,
the Hermite function, and related functions.
JACOBI_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Jacobi polynomial and associated functions.
LAGUERRE_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Laguerre polynomial, the generalized Laguerre polynomials,
and the Laguerre function.
LEGENDRE_POLYNOMIAL,
a FORTRAN90 library which
evaluates the Legendre polynomial and associated functions.
LEGENDRE_PRODUCT_POLYNOMIAL,
a FORTRAN90 library which
defines Legendre product polynomials, creating a multivariate
polynomial as the product of univariate Legendre polynomials.
LOBATTO_POLYNOMIAL,
a FORTRAN90 library which
evaluates Lobatto polynomials, similar to Legendre polynomials
except that they are zero at both endpoints.
SPECIAL_FUNCTIONS,
a FORTRAN90 library which
computes the Beta, Error, Gamma, Lambda, Psi functions,
the Airy, Bessel I, J, K and Y, Hankel, Jacobian elliptic, Kelvin, Mathieu,
Struve functions,
spheroidal angular functions, parabolic cylinder functions,
hypergeometric functions,
the Bernoulli and Euler numbers,
the Hermite, Laguerre and Legendre polynomials,
the cosine, elliptic, exponential, Fresnel and sine integrals,
by Shanjie Zhang, Jianming Jin;
TEST_VALUES,
a FORTRAN90 library which
contains a few test values of many functions.
Reference:
-
Milton Abramowitz, Irene Stegun,
Handbook of Mathematical Functions,
National Bureau of Standards, 1964,
ISBN: 0-486-61272-4,
LC: QA47.A34.
-
Robert Banks,
Slicing Pizzas, Racing Turtles, and Further Adventures in Applied Mathematics,
Princeton, 1999,
ISBN13: 9780691059471,
LC: QA93.B358.
-
Frank Benford,
The Law of Anomalous Numbers,
Proceedings of the American Philosophical Society,
Volume 78, 1938, pages 551-572.
-
Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Second Edition,
Springer, 1987,
ISBN: 0387964673,
LC: QA76.9.C65.B73.
-
Chad Brewbaker,
Lonesum (0,1)-matrices and poly-Bernoulli numbers of negative
index,
Master of Science Thesis,
Computer Science Department,
Iowa State University, 2005.
-
William Briggs, Van Emden Henson,
The DFT: An Owner's Manual for the Discrete Fourier Transform,
SIAM, 1995,
ISBN13: 978-0-898713-42-8,
LC: QA403.5.B75.
-
Theodore Chihara,
An Introduction to Orthogonal Polynomials,
Gordon and Breach, 1978,
ISBN: 0677041500,
LC: QA404.5 C44.
-
William Cody,
Rational Chebyshev Approximations for the Error Function,
Mathematics of Computation,
Volume 23, Number 107, July 1969, pages 631-638.
-
Robert Corless, Gaston Gonnet, David Hare, David Jeffrey,
Donald Knuth,
On the Lambert W Function,
Advances in Computational Mathematics,
Volume 5, Number 1, December 1996, pages 329-359.
-
Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, December 1986, pages 362-376.
-
Walter Gautschi,
Orthogonal Polynomials: Computation and Approximation,
Oxford, 2004,
ISBN: 0-19-850672-4,
LC: QA404.5 G3555.
-
Ralph Hartley,
A More Symmetrical Fourier Analysis Applied to Transmission
Problems,
Proceedings of the Institute of Radio Engineers,
Volume 30, 1942, pages 144-150.
-
Brian Hayes,
The Vibonacci Numbers,
American Scientist,
Volume 87, Number 4, July-August 1999, pages 296-301.
-
Brian Hayes,
Why W?,
American Scientist,
Volume 93, Number 2, March-April 2005, pages 104-108.
-
Ted Hill,
The First Digit Phenomenon,
American Scientist,
Volume 86, Number 4, July/August 1998, pages 358-363.
-
Douglas Hofstadter,
Goedel, Escher, Bach,
Basic Books, 1979,
ISBN: 0465026567,
LC: QA9.8H63.
-
Masanobu Kaneko,
Poly-Bernoulli Numbers,
Journal Theorie des Nombres Bordeaux,
Volume 9, Number 1, 1997, pages 221-228.
-
Cleve Moler,
Trigonometry is a Complex Subject,
MATLAB News and Notes, Summer 1998.
-
Thomas Osler,
Cardan Polynomials and the Reduction of Radicals,
Mathematics Magazine,
Volume 74, Number 1, February 2001, pages 26-32.
-
J Simoes Pereira,
Algorithm 234: Poisson-Charliers Polynomials,
Communications of the ACM,
Volume 7, Number 7, July 1964, page 420.
-
Charles Pinter,
A Book of Abstract Algebra,
Second Edition,
McGraw Hill, 2003,
ISBN: 0072943505,
LC: QA162.P56.
-
Ralph Raimi,
The Peculiar Distribution of First Digits,
Scientific American,
December 1969, pages 109-119.
-
Dennis Stanton, Dennis White,
Constructive Combinatorics,
Springer, 1986,
ISBN: 0387963472,
LC: QA164.S79.
-
Gabor Szego,
Orthogonal Polynomials,
American Mathematical Society, 1992,
ISBN: 0821810235,
LC: QA3.A5.v23.
-
Daniel Velleman, Gregory Call,
Permutations and Combination Locks,
Mathematics Magazine,
Volume 68, Number 4, October 1995, pages 243-253.
-
Divakar Viswanath,
Random Fibonacci sequences and the number 1.13198824,
Mathematics of Computation,
Volume 69, Number 231, July 2000, pages 1131-1155.
-
Michael Waterman,
Introduction to Computational Biology,
Chapman and Hall, 1995,
ISBN: 0412993910,
LC: QH438.4.M33.W38.
-
Eric Weisstein,
CRC Concise Encyclopedia of Mathematics,
CRC Press, 2002,
Second edition,
ISBN: 1584883472,
LC: QA5.W45
-
Stephen Wolfram,
The Mathematica Book,
Fourth Edition,
Cambridge University Press, 1999,
ISBN: 0-521-64314-7,
LC: QA76.95.W65.
-
ML Wolfson, HV Wright,
ACM Algorithm 160: Combinatorial of M Things Taken N at a Time,
Communications of the ACM,
Volume 6, Number 4, April 1963, page 161.
-
Shanjie Zhang, Jianming Jin,
Computation of Special Functions,
Wiley, 1996,
ISBN: 0-471-11963-6,
LC: QA351.C45.
-
Daniel Zwillinger, editor,
CRC Standard Mathematical Tables and Formulae,
30th Edition,
CRC Press, 1996,
ISBN: 0-8493-2479-3,
LC: QA47.M315.
Source Code:
Examples and Tests:
List of Routines:
-
AGM computes the arithmetic-geometric mean of A and B.
-
AGM_VALUES returns some values of the AGM.
-
AGUD evaluates the inverse Gudermannian function.
-
ALIGN_ENUM counts the alignments of two sequences of M and N elements.
-
ARC_COSINE computes the arc cosine function, with argument truncation.
-
ARC_SINE computes the arc sine function, with argument truncation.
-
ATAN4 computes the inverse tangent of the ratio Y / X.
-
BELL returns the Bell numbers from 0 to N.
-
BELL_VALUES returns some values of the Bell numbers.
-
BENFORD returns the Benford probability of one or more significant digits.
-
BERNOULLI_NUMBER computes the Bernoulli numbers B(0) through B(N).
-
BERNOULLI_NUMBER2 evaluates the Bernoulli numbers.
-
BERNOULLI_NUMBER3 computes the value of the Bernoulli number B(N).
-
BERNOULLI_NUMBER_VALUES returns some values of the Bernoulli numbers.
-
BERNOULLI_POLY evaluates the Bernoulli polynomial of order N at X.
-
BERNOULLI_POLY2 evaluates the N-th Bernoulli polynomial at X.
-
BERNSTEIN_POLY evaluates the Bernstein polynomials at a point X.
-
BERNSTEIN_POLY_VALUES returns some values of the Bernstein polynomials.
-
BETA returns the value of the Beta function.
-
BETA_VALUES returns some values of the Beta function.
-
BPAB evaluates at X the Bernstein polynomials based in [A,B].
-
CARDAN evaluates the Cardan polynomials.
-
CARDAN_POLY_COEF computes the coefficients of the N-th Cardan polynomial.
-
CATALAN computes the Catalan numbers, from C(0) to C(N).
-
CATALAN_CONSTANT returns the value of Catalan's constant.
-
CATALAN_ROW_NEXT computes row N of Catalan's triangle.
-
CATALAN_VALUES returns some values of the Catalan numbers.
-
CHARLIER evaluates Charlier polynomials at a point.
-
CHEBY_T_POLY evaluates Chebyshev polynomials T(n,x).
-
CHEBY_T_POLY_COEF evaluates coefficients of Chebyshev polynomials T(n,x).
-
CHEBY_T_POLY_VALUES returns values of Chebyshev polynomials T(n,x).
-
CHEBY_T_POLY_ZERO returns zeroes of Chebyshev polynomials T(n,x).
-
CHEBY_U_POLY evaluates Chebyshev polynomials U(n,x).
-
CHEBY_U_POLY_COEF evaluates coefficients of Chebyshev polynomials U(n,x).
-
CHEBY_U_POLY_VALUES returns values of the Chebyshev polynomial U(n,x).
-
CHEBY_U_POLY_ZERO returns zeroes of Chebyshev polynomials U(n,x).
-
CHEBYSHEV_DISCRETE evaluates discrete Chebyshev polynomials at a point.
-
COLLATZ_COUNT counts the number of terms in a Collatz sequence.
-
COLLATZ_COUNT_MAX seeks the maximum Collatz count for 1 through N.
-
COLLATZ_COUNT_VALUES returns some values of the Collatz count function.
-
COMB_ROW computes row N of Pascal's triangle.
-
COMMUL computes a multinomial combinatorial coefficient.
-
COMPLETE_SYMMETRIC_POLY evaluates a complete symmetric polynomial.
-
COS_DEG returns the cosine of an angle given in degrees.
-
COS_POWER_INT evaluates the cosine power integral.
-
COS_POWER_INT_VALUES returns some values of the cosine power integral.
-
DELANNOY returns the Delannoy numbers up to orders (M,N).
-
E_CONSTANT returns the value of the base of the natural logarithm system.
-
ERF_VALUES returns some values of the ERF or "error" function.
-
ERROR_F evaluates the error function ERF.
-
ERROR_F_INVERSE inverts the error function ERF.
-
EULER_CONSTANT returns the value of the Euler-Mascheroni constant.
-
EULER_NUMBER computes the Euler numbers.
-
EULER_NUMBER2 computes the Euler numbers.
-
EULER_NUMBER_VALUES returns some values of the Euler numbers.
-
EULER_POLY evaluates the N-th Euler polynomial at X.
-
EULERIAN computes the Eulerian number E(N,K).
-
F_HOFSTADTER computes the Hofstadter F sequence.
-
FIBONACCI_DIRECT computes the N-th Fibonacci number directly.
-
FIBONACCI_FLOOR returns the largest Fibonacci number less than or equal to N.
-
FIBONACCI_RECURSIVE computes the first N Fibonacci numbers.
-
G_HOFSTADTER computes the Hofstadter G sequence.
-
GAMMA_LOG_VALUES returns some values of the Log Gamma function.
-
GAMMA_VALUES returns some values of the Gamma function.
-
GEGENBAUER_POLY computes the Gegenbauer polynomials C(I,ALPHA,X).
-
GEGENBAUER_POLY_VALUES returns some values of the Gegenbauer polynomials.
-
GEN_HERMITE_POLY evaluates the generalized Hermite polynomials at X.
-
GEN_LAGUERRE_POLY evaluates generalized Laguerre polynomials.
-
GUD evaluates the Gudermannian function.
-
GUD_VALUES returns some values of the Gudermannian function.
-
H_HOFSTADTER computes the Hofstadter H sequence.
-
HERMITE_POLY evaluates the physicist's Hermite polynomials at X.
-
HERMITE_POLY_COEF: coefficients of the physicist's Hermite polynomial H(n,x).
-
HERMITE_POLY_VALUES returns some values of the Hermite polynomial.
-
HYPER_2F1_VALUES returns some values of the hypergeometric function 2F1.
-
I4_CHOOSE computes the binomial coefficient C(N,K).
-
I4_FACTOR factors an integer into prime factors.
-
I4_FACTORIAL computes the factorial of N.
-
I4_FACTORIAL_VALUES returns values of the factorial function.
-
I4_FACTORIAL2 computes the double factorial function.
-
I4_FACTORIAL2_VALUES returns values of the double factorial function.
-
I4_HUGE returns a "huge" I4.
-
I4_IS_PRIME reports whether an integer is prime.
-
I4_IS_TRIANGULAR determines whether an integer is triangular.
-
I4_PARTITION_DISTINCT_COUNT returns any value of Q(N).
-
I4_POCHHAMMER returns the value of ( I * (I+1) * ... * (J-1) * J ).
-
I4_SWAP swaps two I4's.
-
I4_TO_TRIANGLE converts an integer to triangular coordinates.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
I4MAT_PRINT prints an I4MAT.
-
I4MAT_PRINT_SOME prints some of an I4MAT.
-
JACOBI_POLY evaluates the Jacobi polynomials at X.
-
JACOBI_POLY_VALUES returns some values of the Jacobi polynomial.
-
JACOBI_SYMBOL evaluates the Jacobi symbol (Q/P).
-
KRAWTCHOUK evaluates the Krawtchouk polynomials at X.
-
LAGUERRE_ASSOCIATED evaluates associated Laguerre polynomials L(N,M,X).
-
LAGUERRE_POLY evaluates the Laguerre polynomials at X.
-
LAGUERRE_POLY_COEF evaluates the Laguerre polynomial coefficients.
-
LAGUERRE_POLYNOMIAL_VALUES: some values of the Laguerre polynomial L(n,x).
-
LAMBERT_W estimates the Lambert W function.
-
LAMBERT_W_CRUDE is a crude estimate of the Lambert W function.
-
LAMBERT_W_VALUES returns some values of the Lambert W function.
-
LEGENDRE_ASSOCIATED evaluates the associated Legendre functions.
-
LEGENDRE_ASSOCIATED_NORMALIZED: normalized associated Legendre functions.
-
LEGENDRE_ASSOCIATED_VALUES returns values of associated Legendre functions.
-
LEGENDRE_ASSOCIATED_NORMALIZED_VALUES: normalized associated Legendre.
-
LEGENDRE_FUNCTION_Q evaluates the Legendre Q functions.
-
LEGENDRE_FUNCTION_Q_VALUES returns values of the Legendre Q function.
-
LEGENDRE_POLY evaluates the Legendre polynomials P(N,X) at X.
-
LEGENDRE_POLY_COEF evaluates the Legendre polynomial coefficients.
-
LEGENDRE_POLY_VALUES returns values of the Legendre polynomials.
-
LEGENDRE_SYMBOL evaluates the Legendre symbol (Q/P).
-
LERCH estimates the Lerch transcendent function.
-
LERCH_VALUES returns some values of the Lerch transcendent function.
-
LOCK returns the number of codes for a lock with N buttons.
-
MEIXNER evaluates Meixner polynomials at a point.
-
MERTENS evaluates the Mertens function.
-
MERTENS_VALUES returns some values of the Mertens function.
-
MOEBIUS returns the value of MU(N), the Moebius function of N.
-
MOEBIUS_VALUES returns some values of the Moebius function.
-
MOTZKIN returns the Motzkin numbers up to order N.
-
NORMAL_01_CDF_INV inverts the standard normal CDF.
-
OMEGA returns OMEGA(N), the number of distinct prime divisors of N.
-
OMEGA_VALUES returns some values of the OMEGA function.
-
PARTITION_COUNT_VALUES returns some values of the integer partition count.
-
PARTITION_DISTINCT_COUNT_VALUES returns some values of Q(N).
-
PENTAGON_NUM computes the N-th pentagonal number.
-
PHI computes the number of relatively prime predecessors of an integer.
-
PHI_VALUES returns some values of the PHI function.
-
POLY_BERNOULLI evaluates the poly-Bernolli numbers with negative index.
-
POLY_COEF_COUNT: polynomial coefficient count given dimension and degree.
-
PRIME returns any of the first PRIME_MAX prime numbers.
-
PSI_VALUES returns some values of the Psi or Digamma function.
-
PYRAMID_NUM returns the N-th pyramidal number.
-
R4_UNIFORM_01 returns a unit pseudorandom R4.
-
R8_ACOSH returns the inverse hyperbolic cosine of a number.
-
R8_ASINH returns the inverse hyperbolic sine of a number.
-
R8_ATANH returns the inverse hyperbolic tangent of a number.
-
R8_CAS returns the "casine" of an R8.
-
R8_CHOOSE computes the combinatorial coefficient C(N,K).
-
R8_COT returns the cotangent of an angle.
-
R8_COT_DEG returns the cotangent of an angle given in degrees.
-
R8_CSC returns the cosecant of X.
-
R8_CSC_DEG returns the cosecant of an angle given in degrees.
-
R8_EPSILON returns the R8 roundoff unit.
-
R8_FACTORIAL computes the factorial of N.
-
R8_FACTORIAL_LOG computes the natural logarithm of the factorial of N.
-
R8_FACTORIAL_LOG_VALUES returns values of log(factorial(N)).
-
R8_FACTORIAL_VALUES returns values of the real factorial function.
-
R8_FACTORIAL2 computes the double factorial function.
-
R8_GAMMA evaluates Gamma(X) for a real argument.
-
R8_GAMMA_LOG calculates the natural logarithm of GAMMA ( X ) for positive X.
-
R8_HUGE returns a very large R8.
-
R8_HYPER_2F1 evaluates the hypergeometric function F(A,B,C,X).
-
R8_NINT returns the nearest integer to an R8.
-
R8_PI returns the value of Pi.
-
R8_PSI evaluates the function Psi(X).
-
R8_UNIFORM_01 returns a unit pseudorandom R8.
-
R8POLY_DEGREE returns the degree of a polynomial in power sum form.
-
R8POLY_PRINT prints out a polynomial.
-
R8POLY_VAL_HORNER evaluates a polynomial using Horner's method.
-
R8POLY_VALUE evaluates an R8POLY
-
R8VEC_PRINT prints an R8VEC.
-
R8VEC_PRINT_SOME prints "some" of an R8VEC.
-
R8VEC_UNIFORM returns a scaled pseudorandom R8VEC.
-
SEC_DEG returns the secant of an angle given in degrees.
-
SIGMA returns the value of SIGMA(N), the divisor sum.
-
SIGMA_VALUES returns some values of the Sigma function.
-
SIN_DEG returns the sine of an angle given in degrees.
-
SIN_POWER_INT evaluates the sine power integral.
-
SIN_POWER_INT_VALUES returns some values of the sine power integral.
-
SLICE: maximum number of pieces created by a given number of slices.
-
SPHERICAL_HARMONIC evaluates spherical harmonic functions.
-
SPHERICAL_HARMONIC_VALUES returns values of spherical harmonic functions.
-
STIRLING1 computes the Stirling numbers of the first kind.
-
STIRLING2 computes the Stirling numbers of the second kind.
-
TAN_DEG returns the tangent of an angle given in degrees.
-
TAU returns the value of TAU(N), the number of distinct divisors of N.
-
TAU_VALUES returns some values of the Tau function.
-
TETRAHEDRON_NUM returns the N-th tetrahedral number.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TRIANGLE_NUM returns the N-th triangular number.
-
TRIANGLE_TO_I4 converts a triangular coordinate to an integer.
-
V_HOFSTADTER computes the Hofstadter V sequence.
-
VIBONACCI computes the first N Vibonacci numbers.
-
ZECKENDORF produces the Zeckendorf decomposition of a positive integer.
-
ZERNIKE_POLY evaluates a Zernike polynomial at RHO.
-
ZERNIKE_POLY_COEF: coefficients of a Zernike polynomial.
-
ZETA estimates the Riemann Zeta function.
-
ZETA_VALUES returns some values of the Riemann Zeta function.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 04 November 2013.