I would like to use pgfplots to create a figure where I plot curves that have a recursive formula. I tried a very simple case that uses the declare function command to see whether this is possible, and I can't compile (TeX capacity exceeded). Is it even possible to do this?
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[
declare function={test(\p)=ifthenelse(\p>1, test(\p-1), 0.5);},
]
\begin{axis}[]
% use TeX as calculator:
\addplot [mark=none] {x};
\addplot [mark=none] {test(0)};
\end{axis}
\end{tikzpicture}
\end{document}

)missing.... trydeclare function={test(\p)=ifthenelse(\p>1, test(\p-1), 0.5);}– Aug 22 '18 at 14:37tikzmath, see p. 640 of the pgfmanual. – Aug 22 '18 at 14:41declare functionis the simplicity. By the way, what version of the pdfmanual? I look at page 640 in v2.10 and there's nothing related to this. – aaragon Aug 22 '18 at 14:46Math Librarystarts and there is an example for the recursive definition of the Fibonacci numbers. Just search for "Fibonacci" in your version. – Aug 22 '18 at 14:49