# Why do 2 identical function definitions with different names produce two different plots?

In the code snippet below I would have expected both r(x) and s(x) to be the same line, but the output is two radically different lines as shown below.

If there is a problem using the name r as a function name, then I would have expected some sort of error message, but did not find one.

\documentclass{article}
\usepackage{amsmath}
\usepackage{pgfplots}

\pgfmathdeclarefunction{r}{1}{\pgfmathparse{(2.0)}}
\pgfmathdeclarefunction{s}{1}{\pgfmathparse{(2.0)}}

\tikzstyle{MyPlotStyle}=[domain=-5:5, samples=50, ultra thick]

\begin{document}
Plot of $r(x)=2$ and $s(x)=2$ using PGF Version \pgfversion.

\begin{tikzpicture}
\begin{axis}

In pgfmathparser.code.tex, r is defined as a math operator that applies the deg function, to be able to specify angles in radians (\pgfmathparse{3.14r}\pgfmathresult yields (almost) 180), so you shouldn't use this name for your own functions. I agree, though, that there should be an error message if you try to define a new function with a name that's already taken by an operator, especially since operators seem to take precedence. You might want to file a bug report / feature request for this.