  We propose an optimal approximation formula for analytic functions that are
defined on a complex region containing the real interval $(-1,1)$ and possibly
have algebraic singularities at the endpoints of the interval. As a space of
such functions,we consider a Hardy space with the weight given by $w_{\mu}(z) =
(1-z^{2})^{\mu/2}$ for $\mu > 0$, and formulate the optimality of an
approximation formula for the functions in the space. Then, we propose an
optimal approximation formula for the space for any $\mu > 0$ as opposed to
existing results with the restriction $0 < \mu < \mu_{\ast}$ for a certain
constant $\mu_{\ast}$. We also provide the results of numerical experiments to
show the performance of the proposed formula.
