POLPAK
Recursive Polynomials
POLPAK
is a Python 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 FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version
Related Data and Programs:
TEST_VALUES,
a Python library which
contains some sample values of many mathematical functions.
Source Code:
-
agm_values.py,
returns selected values of the arithmetic geometric mean function.
-
agud.py,
computes the inverse Gudermannian.
-
align_enum.py,
counts the alignments of two sequences of M and N elements;
-
bell.py,
evaluates the Bell numbers;
-
bell_values.py,
returns selected values of the Bell numbers.
-
benford.py,
returns the Benford probability of one or more significant digits;
-
bernoulli_number.py,
returns the Bernoulli numbers;
-
bernoulli_number2.py,
returns the Bernoulli numbers;
-
bernoulli_number3.py,
computes the Bernoulli numbers;
-
bernoulli_number_values.py,
returns selected values of the Bernoulli numbers.
-
bernoulli_poly.py,
evaluates a Bernoulli polynomial;
-
bernoulli_poly2.py,
evaluates the Nth Bernoulli polynomial at X;
-
bernstein_poly.py,
evaluates the Bernstein polynomials at a point;
-
bernstein_poly_01_values.py,
returns some values of the Bernstein polynomials;
-
beta_values.py
returns some values of the Beta function.
-
bpab.py,
evaluates the Bernstein polynomials defined on the interval [A,B];
-
cardan_poly.py,
evaluates the Cardan polynomials;
-
cardan_poly_coef.py,
returns the coefficients of a Cardan polynomial;
-
cardinal_cos.py,
evaluates the cardinal cosine basis functions.
-
cardinal_sin.py,
evaluates the cardinal sine basis functions.
-
catalan.py,
evaluates the Catalan numbers;
-
catalan_row_next.py,
computes the next row of Catalan numbers;
-
catalan_values.py
returns some values of the Catalan numbers.
-
charlier.py,
evaluates the Charlier polynomials;
-
cheby_t_poly.py,
evaluates the Chebyshev T polynomials;
-
cheby_t_poly_coef.py,
returns the coefficients of the Chebyshev T polynomials;
-
cheby_t_values.py,
returns some values of the Chebyshev T polynomials;
-
cheby_t_poly_zero.py,
returns the zeros of the Chebyshev T polynomials;
-
cheby_u_poly.py,
evaluates the Chebyshev U polynomials;
-
cheby_u_poly_coef.py,
returns the coefficients of the Chebyshev U polynomials;
-
cheby_u_values.py,
returns some values of the Chebyshev U polynomials;
-
cheby_u_poly_zero.py,
returns the zeros of the Chebyshev U polynomials;
-
chebyshev_discrete.py,
evaluates the discrete Chebyshev polynomials;
-
collatz_count.py,
counts the length of the Collatz sequence for a seed of N;
-
collatz_count_max.py,
seeks the maximum Collatz count from 1 to N.
-
collatz_count_values.py,
stores some values of the Collatz count function;
-
comb_row_next.py,
computes the next row of Pascal's triangle;
-
commul.py,
computes a multinomial coefficient;
-
complete_symmetric_poly.py,
evaluates the complete symmetric polynomial tau(n,r).
-
cos_power_int.py,
returns the value of the integral of the N-th power of
the cosine function;
-
cos_power_int_values.py,
returns some values of the integral of the N-th power of
the cosine function;
-
delannoy.py,
computes the Delannoy numbers;
-
erf_values.py,
returns selected values of the error function.
-
euler_number.py,
evaluates the Euler numbers;
-
euler_number2.py,
computes the Euler numbers;
-
euler_number_values.py,
returns some values of the Euler numbers;
-
euler_poly.py,
evaluates the N-th Euler polynomial at X;
-
eulerian.py,
computes the eulerian number E(N,K);
-
f_hofstadter.py,
computes the Hofstadter F function;
-
fibonacci_direct.py,
computes the N-th Fibonacci number directly;
-
fibonacci_floor.py,
computes the largest Fibonacci number less than or equal to N;
-
fibonacci_recursive.py,
computes the first N Fibonacci numbers recursively;
-
g_hofstadter.py,
computes the Hofstadter G function;
-
gamma_values.py,
returns selected values of the Gamma function.
-
gamma_log_values.py,
returns selected values of the Log(Gamma) function.
-
gegenbauer_poly.py,
evaluates the Gegenbauer polynomials at a point;
-
gegenbauer_poly_values.py,
returns some values of the Gegenbauer polynomials;
-
gen_hermite_poly.py,
evaluates the generalized Hermite polynomials;
-
gen_laguerre_poly.py,
evaluates the generalized Laguerre polynomials;
-
gud.py,
computes the Gudermannian function.
-
gud_values.py,
returns selected values of the Gudermannian function.
-
hail.py,
computes the hail function;
-
h_hofstadter.py,
computes the Hofstadter H function;
-
hermite_poly_phys.py,
evaluates the Hermite physicist polynomials;
-
hermite_poly_phys_coef.py,
evaluates the Hermite physicist polynomial coefficients;
-
hermite_poly_phys_values.py,
returns some values of the Hermite physicist polynomials;
-
hyper_2f1_values.py,
returns some values of the 2F1 hypergeometric function.
-
i4_choose.py,
computes the binomial coefficient C(N,K) as an I4.
-
i4_factor.py,
factors an integer into prime factors;
-
i4_factorial.py,
evaluates the factorial function.
-
i4_factorial_values.py,
returns selected values of the factorial function.
-
i4_factorial2.py,
computes the double factorial function;
-
i4_factorial2_values.py,
returns some values of the double factorial function;
-
i4_is_prime.py,
determines whether an integer is prime;
-
i4_is_triangular.py,
determines whether an integer is triangular;
-
i4_partition_distinct_count_values.py,
computes the value of Q(N);
-
i4_to_triangle.py,
converts an integer to triangular coordinates;
-
i4_uniform_ab.py,
returns a scaled uniform I4 between A and B.
-
i4mat_print.py,
prints an I4MAT.
-
i4mat_print_some.py,
prints some of an I4MAT.
-
i4vec_print.py,
prints an I4VEC.
-
jacobi_poly.py,
evaluates the Jacobi polynomials at a point;
-
jacobi_poly_values.py,
returns some values of the Jacobi polynomials;
-
jacobi_symbol.py,
evaluates the Jacobi symbol (Q/P);
-
krawtchouk.py,
evaluates the Krawtchouk polynomials;
-
laguerre_associated.py,
evaluates the associated Laguerre polynomials L(N,M)(X);
-
laguerre_poly.py,
evaluates the Laguerre polynomials;
-
laguerre_poly_coef.py,
evaluates the Laguerre polynomial coefficients;
-
laguerre_polynomial_values.py,
returns some values of the Laguerre polynomials;
-
legendre_associated.py,
evaluates the associated Legendre functions P(N,M)(X);
-
legendre_associated_values.py,
returns some values of the associated Legendre function;
-
legendre_associated_normalized.py,
evaluates the associated Legendre functions P(N,M)(X),
normalized for use in spherical harmonic calculations;
-
legendre_associated_normalized_sphere_values.py,
returns some values of the normalized associated Legendre function;
-
legendre_function_q.py,
evaluates the Legendre functions Q(N)(X);
-
legendre_function_q_values.py,
returns some values of the Legendre Q(N) functions;
-
legendre_poly_values.py,
returns some values of the Legendre polynomials;
-
legendre_poly.py,
evaluates the Legendre polynomials P(N)(X);
-
legendre_poly_coef.py,
evaluates the coefficients of the Legendre polynomials P(N)(X);
-
legendre_symbol.py,
evaluates the Legendre symbol (Q/P);
-
lerch.py,
evaluates the Lerch transcendent function;
-
lerch_values.py,
returns some values of the Lerch transcendent function;
-
lock.py,
returns the number of codes for a lock with N buttons;
-
meixner.py,
evaluates the Meixner polynomials;
-
mertens.py,
returns the value of the Mertens function;
-
mertens_values.py,
returns some tabulated values of the Mertens function;
-
moebius.py,
returns the value of MU(N), the Moebius function of N;
-
moebius_values.py,
returns some tabulated values of the Moebius function;
-
motzkin.py,
returns the Motzkin numbers up to order N;
-
normal_01_cdf_inverse.py
inverts the Normal 01 CDF.
-
normal_01_cdf_values.py
returns values of the Normal01 CDF.
-
omega.py,
returns the number of distinct prime divisors of an integer;
-
omega_values.py,
returns some values of the Omega function;
-
partition_distinct_count_values.py,
returns some values of Q(N);
-
pentagon_num.py,
returns the N-th pentagonal number;
-
phi.py,
returns the number of relatively prime predecessors of an integer;
-
phi_values.py,
returns some values of the Phi function;
-
plane_partition_num.py,
returns the number of plane partitions of an integer.
-
poly_bernoulli.py,
evaluates the poly-Bernoulli numbers of negative index;
-
poly_coef_count.py,
counts the coefficients in a polynomial of given degree and dimension.
-
prime.py,
returns a prime number from a stored table.
-
psi_values.py,
returns some values of the Psi function;
-
pyramid_num.py,
returns the N-th pyramidal number;
-
pyramid_square_num.py,
returns the N-th pyramidal square number;
-
r8_agm.py,
computes the arithmetic geometric mean of two numbers;
-
r8_beta.py,
evaluates the Beta function;
-
r8_choose.py,
computes the combinatorial coefficient C(N,K);
-
r8_erf.py,
evaluates the error function;
-
r8_erf_inverse.py,
inverts the error function;
-
r8_euler_constant.py,
returns the value of the Euler-Mascheroni constant;
-
r8_factorial.py,
evaluates the factorial function.
-
r8_factorial_values.py
returns values of the real factorial function.
-
r8_factorial_log.py,
computes the logarithm of the (real) factorial function;
-
r8_factorial_log_values.py,
returns some values of the logarithm of the (real) factorial function;
-
r8_gamma.py
returns values of the gamma function
(only here temporarily, because our local Python installation
is not making gamma available.)
-
r8_gamma_log.py
returns values of the gamma function
(only here temporarily, because our local Python installation
is not making lgamma available.)
-
r8_huge.py,
returns a "huge" R8;
-
r8_mop.py,
returns a power of -1 as an R8;
-
r8_nint.py,
rounds an R8 to the nearest integer;
-
r8_pi.py,
returns the value of Pi;
-
r8_psi.py,
returns the Psi function;
-
r8_uniform_01.py,
returns a unit pseudorandom R8.
-
r8_uniform_ab.py,
returns a scaled pseudorandom R8.
-
r8poly_degree.py
returns the degree of an R8POLY.
-
r8poly_print.py,
prints a polynomial;
-
r8poly_value_horner.py,
evaluates a polynomial using Horner's method;
-
r8vec_linspace.py,
returns an R8VEC of values evenly spaced between given limits.
-
r8vec_print.py,
prints an R8VEC.
-
sigma.py,
returns the value of SIGMA(N), the divisor sum;
-
sigma_values.py,
returns some values of the Sigma function;
-
simplex_num.py,
returns the N-th simplex number in M dimensions;
-
sin_power_int.py,
returns the value of the integral of the N-th power of
the sine function;
-
sin_power_int_values.py,
returns some values of the integral of the N-th power of
the sine function;
-
slice.py,
maximum number of pieces created by a given number of slices.
-
spherical_harmonic.py,
evaluates the spherical harmonic function.
-
spherical_harmonic_values.py,
returns some values of the spherical harmonic function;
-
stirling1.py,
returns the Stirling numbers of the first kind;
-
stirling2.py,
returns the Stirling numbers of the second kind;
-
tau.py,
evaluates the Tau function, the number of distinct divisors;
-
tau_values.py,
returns some values of the Tau function;
-
tetrahedron_num.py,
returns the N-th tetrahedral number;
-
timestamp.py,
prints the current YMDHMS date as a timestamp;
-
triangle_num.py,
returns the N-th triangle number;
-
triangle_to_i4.py,
converts a triangular coordinate to an integer;
-
v_hofstadter.py,
computes the Hofstadter V function;
-
vibonacci.py,
computes the Vibonacci numbers;
-
zernike_poly.py,
evaluates a Zernike polynomial;
-
zeta.py,
approximates the Riemann Zeta function;
-
zeta_values.py,
returns some stored values of the Riemann Zeta function;
NOT CONVERTED YET
Examples and Tests:
You can go up one level to
the Python source codes.
Last revised on 25 February 2015.