Suppose, $u$ is the unique real solution of $x^x=\pi$ and $v$ is the unique real solution of $x\cdot e^x=\pi$
Expressed with the Lambert-w-function we have $u=e^{W(\ln(\pi))}$ and $v=W(\pi)$
Wolfram gives the following very good approximations
$$u\approx \frac{1256-84\pi-5\pi^2}{-232-157\pi+125\pi^2}$$
with an absolute error of less than $2\cdot 10^{-18}$
and $$v\approx \frac{125-211\pi+235\pi^2}{-712-461\pi+387\pi^2}$$
with an absolute error of less than $2\cdot 10^{-19}$
- How can I calculate such approximations ?
The approximations look like Pade-approximations. PARI/GP can calculate such Pade-approximations, but I only managed to do it for functions and not for real numbers.
The object is obviously to find a rational function $f(x)$, such that for a given constant $s$, $f(s)$ is the best approximation of a given number (given some limit to the degrees of the polynomials).
With the bestappr-function, PARI could then find a function $g(x)$ such that for a given limit of the absolute value of the coefficients, $g(x)$ is the best approximation of $f(x)$.
But how can I get the function $f(x)$ ?
I think that Alpha uses an integer relation algorithm (PSLQ or LLL) implemented too in pari/gp.
The trick here is to use the pari/gp command lindep with a precision of $18$ digits (forced by alpha I think) :
this means that $-1256+84\pi+5\pi^2-232\,u-157\,u\,\pi+125\,u\,\pi^2\approx 0\;$ or that $$u\approx\frac{1256-84\pi-5\pi^2}{-232 -157\pi+125\pi^2}$$ Change the value $18$ in lindep (and the precision of $u$) if more precise results are wished (or add higher powers of $\pi$ and so on...)