What is the idea behind expm1 to avoid cancellation error? It is well known that when x is close to 0, computing exp(x) - 1 introduces significant cancelation errors. As such, we have expm1 implemented in c99 and python. 
My question is how expm1 avoids cancellation error? Can anyone give me a general idea without too many nitty-gritty implementation details?

Around $x=0$ the exponential is computed as some version of $1+xp(x)$ or $\frac{1+xg(x^2)}{1-xg(x^2)}$ or similar with some polynomials that approximate the exact term behind them in an uniform fashion on some interval. 
For other values the logarithm laws $e^x=(e^{x/2^m})^{2^m}$ or $e^x=2^k3^me^{x-k\ln2-m\ln3}$ are used to reduce the argument to some small value.
Then it is easy to modify those approximating expressions to return the expm1(x) value, in the mentioned cases $xp(x)$ or $\frac{2xg(x^2)}{1-xg(x^2)}$.
