[sf.cmath.legendre]

# 29 Numerics library [[numerics]](./#numerics)

## 29.7 Mathematical functions for floating-point types [[c.math]](c.math#sf.cmath.legendre)

### 29.7.6 Mathematical special functions [[sf.cmath]](sf.cmath#legendre)

#### 29.7.6.18 Legendre polynomials [sf.cmath.legendre]

[ð](#lib:legendre)

`floating-point-type legendre(unsigned l, floating-point-type x);
float        legendref(unsigned l, float x);
long double  legendrel(unsigned l, long double x);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10632)

*Effects*: These functions compute the Legendre polynomials of their
respective argumentsl and x[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10638)

*Returns*: Pâ(x),
where Pâ is given by Formula [29.38](#eq:sf.cmath.legendre),l is l, andx is x[.](#2.sentence-1)

Pâ(x)=12ââ!dâdxâ(x2â1)âÂ , forÂ |x|â¤1(29.38)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L10651)

*Remarks*: The effect of calling each of these functions
is implementation-defined
if l >= 128[.](#3.sentence-1)
