The following code generates the wrong plot:
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain = 0:1, samples = 500]
\addplot[color = black] {pi/((pi/2)+atan(x/sqrt(1-x^2)))};
\end{axis}
\end{tikzpicture}
\end{document}
Obviously, for x tending to 1 the function tends to 1 and not to 0 as in the plot. See also
What am I doing wrong?

