<s>
In	O
mathematics	O
,	O
the	O
Lanczos	B-Algorithm
approximation	I-Algorithm
is	O
a	O
method	O
for	O
computing	O
the	O
gamma	O
function	O
numerically	O
,	O
published	O
by	O
Cornelius	O
Lanczos	O
in	O
1964	O
.	O
</s>
<s>
The	O
series	O
A	O
is	O
convergent	B-Algorithm
,	O
and	O
may	O
be	O
truncated	O
to	O
obtain	O
an	O
approximation	O
with	O
the	O
desired	O
precision	O
.	O
</s>
<s>
By	O
choosing	O
an	O
appropriate	O
g	O
(	O
typically	O
a	O
small	O
integer	O
)	O
,	O
only	O
some	O
5	O
–	O
10	O
terms	O
of	O
the	O
series	O
are	O
needed	O
to	O
compute	O
the	O
gamma	O
function	O
with	O
typical	O
single	O
or	O
double	O
floating-point	B-Algorithm
precision	O
.	O
</s>
<s>
The	O
Lanczos	B-Algorithm
approximation	I-Algorithm
was	O
popularized	O
by	O
Numerical	O
Recipes	O
,	O
according	O
to	O
which	O
computing	O
the	O
gamma	O
function	O
becomes	O
"	O
not	O
much	O
more	O
difficult	O
than	O
other	O
built-in	O
functions	O
that	O
we	O
take	O
for	O
granted	O
,	O
such	O
as	O
sinx	O
or	O
ex.	O
"	O
</s>
<s>
The	O
method	O
is	O
also	O
implemented	O
in	O
the	O
GNU	B-Application
Scientific	I-Application
Library	I-Application
,	O
Boost	B-Language
,	O
CPython	B-Language
and	O
musl	B-Language
.	O
</s>
<s>
where	O
represents	O
the	O
(	O
n	O
,	O
m	O
)	O
th	O
element	O
of	O
the	O
matrix	B-Architecture
of	O
coefficients	O
for	O
the	O
Chebyshev	O
polynomials	O
,	O
which	O
can	O
be	O
calculated	O
recursively	O
from	O
these	O
identities	O
:	O
</s>
<s>
Godfrey	O
(	O
2001	O
)	O
describes	O
how	O
to	O
obtain	O
the	O
coefficients	O
and	O
also	O
the	O
value	O
of	O
the	O
truncated	O
series	O
A	O
as	O
a	O
matrix	B-Architecture
product	O
.	O
</s>
<s>
The	O
following	O
implementation	O
in	O
the	O
Python	B-Language
programming	I-Language
language	I-Language
works	O
for	O
complex	O
arguments	O
and	O
typically	O
gives	O
13	O
correct	O
decimal	O
places	O
.	O
</s>
