Gegenbauer Polynomials



Gegenbauer Polynomials
Gegenbauer polynomials (ultraspherical polynomials), Cαn, α > -1/2, are orthogonal with support interval [-1,1] with weight function
w(x) =
0for x ≤ -1
(1 - x²)α - 1/2 for -1 < x < 1
0for x ≥ 1
and normalized by the requirement that Cαn(1) = Γ(n + 2α) / [ n! Γ(2 α) ].

Cαn satisfies the three-term recurrence relation
(n + 1) Cαn+1(x) = 2 (n + α) x Cαn(x) - (n + 2 α - 1)Cαn-1(x)for n ≥ 1

with starting values
Cα0(x) = 1, Cα1(x) = 2 α x.

Function List

  • double Gegenbauer_Cn( double x, double alpha, int n )

    This function returns Cαn(x) where Cαn(x) is described above.

  • long double xGegenbauer_Cn( long double x, long double alpha, int n )

    This function returns Cαn(x) where Cαn(x) is described above.

  • void Gegenbauer_Cn_Sequence( double C[ ], double x, double alpha, int max_n )

    This function returns Cαn(x), for n = 0, 1, …, max_n in the array C[ ] where Cαn(x) is described above. Note that C[ ] should be declared as double C[N] where
    N ≥ max_n + 1.

  • void xGegenbauer_Cn_Sequence( long double C[ ], long double x, long double alpha, int max_n )

    This function returns Cαn(x), for n = 0, 1, …, max_n in the array C[ ] where Cαn(x) is described above. Note that C[ ] should be declared as long double C[N] where
    N ≥ max_n + 1.

  • double Gegenbauer_Cn_Series( double x, double alpha, double a[ ], int degree )

    This function returns Σk=0na[k] Cαk(x) where n = degree and Cαk(x) for k = 0, …, n is described above.

  • long double xGegenbauer_Cn_Series( long double x, long double alpha, long double a[ ], int degree )

    This function returns Σk=0na[k] Cαk(x) where n = degree and Cαk(x) for k = 0, …, n is described above.

Source Code

C source code is available for these routines: