FLINT3.7.0-dev

arb_hypgeom_legendre_p_ui_zero, arb_hypgeom_legendre_p_ui_one, arb_hypgeom_legendre_p_ui_asymp, arb_hypgeom_legendre_p_ui_rec, arb_hypgeom_legendre_p_ui

Synopsis#include <flint/arb_hypgeom.h>
void arb_hypgeom_legendre_p_ui_zero(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)source
void arb_hypgeom_legendre_p_ui_one(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)source
void arb_hypgeom_legendre_p_ui_asymp(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong K, slong prec)source
void arb_hypgeom_legendre_p_ui_rec(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong prec)source
void arb_hypgeom_legendre_p_ui(arb_t res, arb_t res_prime, ulong n, const arb_t x, slong prec)source

Sets res to the Legendre polynomial Pn(x)P_n(x) and res_prime to its derivative Pn′(x)P'_n(x). Either output may be NULL.

The algorithm is that of Johansson and Mezzarobba [JM2018]; see Legendre functions and orthogonal polynomials.

  • arb_hypgeom_legendre_p_ui_zero and arb_hypgeom_legendre_p_ui_one sum the hypergeometric expansions at x=0x = 0 and x=1x = 1, and arb_hypgeom_legendre_p_ui_asymp the asymptotic expansion in nn valid on (−1,1)(-1, 1) with the error bound of Bogaert, Michiels and Fostier [Bog2012]. The parameter KK is the exact number of terms; if the truncated expansion is not the exact polynomial, a bound for the remainder is added.
  • arb_hypgeom_legendre_p_ui_rec uses the three-term recurrence in fixed-point arithmetic; it is meant for x∈(−1,1)x \in (-1,1), moderate nn and modest precision.
  • arb_hypgeom_legendre_p_ui reduces to x≥0x \ge 0 by symmetry, picks the cheapest method from estimates of the number of terms and of the cancellation in each series, raises the working precision to compensate for the cancellation, and bounds the error propagated from an inexact xx with arb_hypgeom_legendre_p_ui_deriv_bound.

References#

  • [JM2018] F. Johansson and M. Mezzarobba, "Fast and rigorous arbitrary-precision computation of Gauss-Legendre quadrature nodes and weights", preprint (2018), https://arxiv.org/abs/1802.03948
  • [Bog2012] I. Bogaert, B. Michiels and J. Fostier, "O(1) computation of Legendre polynomials and Gauss-Legendre nodes and weights for parallel computing", SIAM Journal on Scientific Computing 34:3 (2012), C83-C101
Cite this page

The FLINT team, “arb_hypgeom_legendre_p_ui_zero, arb_hypgeom_legendre_p_ui_one, arb_hypgeom_legendre_p_ui_asymp, arb_hypgeom_legendre_p_ui_rec, arb_hypgeom_legendre_p_ui (arb_hypgeom.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb_hypgeom/arb_hypgeom_legendre_p_ui_zero.html (generated 2026-11-02).