Is it possible to plot a recursive function using pgfplots \addplot command?
I tried like this;
\documentclass{article}
\usepackage{pgfplots}
\pgfmathdeclarefunction{fac}{1}{
\pgfmathparse{(#1<=1)+
(#1>1)*#1*fac(#1-1)
}
}
\begin{document}
fac(5) is \pgfmathparse{fac(5)}\pgfmathresult
\end{document}
But the result seems to be an infinite recursion, as the entire function is being evaluated.

ifthenelse, ...), there is the problem that the arguments are evaluated first. Thus there is an infinite recursion before the stop condition is evaluated. Thus, the recursive function needs to be defined at lower level. Unhappily, there are several different lower levels (e.g. standard,fpu,fixed point arithmetic, ...). Packagepgfplotsuses the numbers in the format of libraryfpu. – Heiko Oberdiek Nov 20 '16 at 23:00pgfplotsor how to define my function withfpu. Do you know of a 'Getting Started' guide or similar for this? – Skeen Nov 20 '16 at 23:27