Rewrite trigonometric expression to be be numerically "stable" Is it possible to write the following function:
$$
f(x) = \begin{cases}
  \frac{x-\sin x}{1- \cos x}& x\neq 0\\
  0 & x=0
\end{cases}
$$
as a composition of elementary functions (including $\mathrm{sinc} (x) = (\sin x) / x)$ so that I get not large numerical errors for $x$ close to zero?
This is the complete list of functions I can use: http://docs.scipy.org/doc/numpy/reference/routines.math.html
This formula is used to compute the area of a circular segment with fixed chord length and given angle.
addendum
I found I can write:
$$
f(x) = \frac{\frac{x}{\sin x} - 1}{x} \frac{x}{\sin x}.
$$
But this is not resolutive. Seems to me that the derivative of the $\mathrm{sinc}$ function cannot be explicitly written in terms of the extended elementary function listed in the link above.
 A: If you use the first two members of the Taylor series of the numerator and the denominator then you get
$$\frac{x-\sin x}{1- \cos x}\approx \frac{x}{3}.$$
The error of this approximation is less than $10^{-8}$ over the interval $(-0.01,0.01).$
A: In the same spirit as  Yves Daoust, for more accuracy than using Taylor series, you could use Pade approximants. The simplest one would be $$\frac{x-\sin x}{1- \cos x}\approx \frac{x \left(420-x^2\right)}{45 \left(28-x^2\right)}$$ The error is extremely small : $\approx 10^{-15}$ over the interval $(-0.01,0.01)$. 
Another  could be $$\frac{x-\sin x}{1- \cos x}\approx \frac{x \left(x^4+12600\right)}{1260 \left(30-x^2\right)}$$
A: You can use
$$\frac{x}{\sin ^2x}+\frac{x}{\tan \left(x\right)\sin \left(x\right)}-\frac{1}{\sin \left(x\right)}-\frac{1}{\tan \left(x\right)}$$
which is equal to the original function, though it is still undefined at 0. It is also equal to
$$\frac{x+x\cos \left(x\right)-\sin \left(x\right)-\sin \left(x\right)\cos \left(x\right)}{\sin ^2\left(x\right)}$$
