Recommended textbook on function approximation on computer There is a cephes math library on the Internet to provide accuracy computation of math function, e.g. sin,cos,tan,erf, gamma, lgamma, etc.
It implements the function in an intelligent way. For example, it uses different asymptotic series on the different domain when computing gamma function and switches to Stirling's approximation when the argument is too large.
Basically, the library uses all means of methods, e.g. Asymptotic series, Numerical Integration, Newton's method, Pade approximation, continued fraction.
If I want to fully understand what it is going on and study how to deduce such formula and implement such numerical algorithms, what are the recommended textbook?
For example, I want to compute an efficient and accurate specialized lgamma_exp(x) = lgamma(exp(x)) with argument in exp(x) rather than in x. There is no way except computing exp(x) first, which might overflow on the computer.
 A: You should seriously consider this book:
Muller, J.-M., Brisebarre, N., de Dinechin, F., Jeannerod, C.-P., Lefèvre, V., Melquiond, G., Revol, N., Stehlé, D., Torres, S. : "Handbook of floating point arithmetic". Springer 2010.
This is a link to Springer's page for the book.
I do not remember if it covers the error-function, but it will explain many of the techniques used to write numerical libraries and it does it very well.
A: This is an answer to your example question.
For large values of the argument of a function, you can rely on asymptotic formulas. In the case of Gamma, you can work with the Stirling approximation
$$\log(\Gamma(e^x))\approx\log\sqrt{2\pi}+(x-1)e^x-\frac x2.$$
the relative error will be on the order of $$\frac{e^{-x}}{12}.$$
A: Also consider another book by Jean-Michel Muller:  Elementary Functions:  Algorithms and Implementations (3rd edition, 2016). Link to publisher.  In fact, searching for papers etc by anyone in the groups at CNRS/ENS Lyon and/or the ARENAIRE project (e.g., at the HAL archives) would probably be beneficial.
