I'm using the TikZ declare function key and getting some weird results with squaring.
\begin{tikzpicture}[declare function={f(\x)=\x*\x;}]
\node {\pgfmathparse{f(-.5)} \pgfmathresult}; % outputs *positive* 0.25, as expected
\end{tikzpicture}
\begin{tikzpicture}[declare function={f(\x)=\x^2;}]
\node {\pgfmathparse{f(-.5)} \pgfmathresult}; % outputs negative -0.25
\end{tikzpicture}
This appears only to affect \pgfmathparse and not \addplot. For example, in the MWE
\documentclass{standalone}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}[declare function={f(\x)=\x^2;}]
\begin{axis}[domain=-1:1]
\addplot {f(x)};
\pgfmathsetmacro{\y}{f(-0.5)}
\addplot coordinates {(-0.5,\y)};
\end{axis}
\end{tikzpicture}
\end{document}
we can see that the point (-0.5,f(-0.5)) is not on the graph of y=f(x) which is definitely not the expected behaviour.
