MiniMaxApproximation is used to generate minimax approximations. I'm interested in the "dividing out the zero" trick.
The documentation discusses a nice example. Suppose we want to construct a minimax approximation of $\cos (x)$ on $x \in [1,2]$. Since the function MiniMaxApproximation uses the relative error the function being approximated can not have a zero in the interval of question ($\cos(\pi/2)=0$). However "it is still possible to deal with such functions, but the zero must be divided out of the function and then multiplied back into the rational function". So instead of approximating $\cos(x)$ we approximate
$$\frac{\cos(x)}{x-\frac{\pi}{2}}$$
The mathematica code to do this is
MiniMaxApproximation[Cos[x]/(x - \[Pi]/2), {x, {1, 2}, 2, 4}][[2, 1]]
as in the documentation. I was wondering if there is a similar trick that can be used with GeneralMiniMaxApproximation. This function approximates parametrically defined functions of the form $(x(t), y(t))$. Note that $\cos (x)$ on $x \in [1,2]$ can be defined parametrically as $(\arccos(t),t)$ where $t \in (\cos(1),\cos(2))$. So the mathematica code to approximate this function looks like
GeneralMiniMaxApproximation[{ArcCos[t], t}, {t, {Cos[1], Cos[2]}, 3,
2}, x]
However it fails because of the zero occuring in the interval of approximation. I was wondering if there is a way to extend the above trick so that it will work with GeneralMiniMaxApproximation??
I would like to stick with using the relative error as opposed to the absolute error.
My attempt:
I thought maybe a shift in the y-axis would do the trick. ie. approximate $\cos (x) + 1$ on $x \in [1,2]$ (which has no zero in this interval). We can subtract the one after. This is equivalent to approximating the parametrically defined function $(\arccos(t-1),t)$ where $t \in (\cos(1)+1,\cos(2)+1)$. The mathematica code is then given by,
GeneralMiniMaxApproximation[ {ArcCos[t - 1], t}, {t, {Cos[1] + 1, Cos[2] + 1}, 2, 3}, x]
But this does not work for some reason. It complains the weight function $t$ could be disappearing. But this is not the case since $t$ is positive on $(\cos(1)+1,\cos(2)+1)$. Any ideas why this doesn't work?


GeneralMiniMaxApproximation[{ArcCos[t - 1], t}, {t, {Cos[2] + 1, Cos[1] + 1}, 2, 3}, x]– xzczd Nov 8 '12 at 5:39