PGFmath doesn't do what you think it does.
When \pgfmathparse
is used, all variables used in the expression must be known. When it sees a division, the divisor is known.
If this divisor is 0, PGFMath issues the error you've pasted.
So, with your notations, for a given x, it can tell you whether f(x) can be computed; but it can't reasonably give you all values of x for which f(x) can be computed.
Mathematically, it would have to check all of ℝ (assuming we are working on ℝ), which is uncountable.
In PGFMath, the number of possible values is finite but huge, and checking all of them would be completely uninteresting, as you would only get numbers of the form 2nk for some k and n in ℤ. No √2, no π, etc.
Another way to see that your expectations aren't very realistic is to think about what the outcome should be for f(x) = 1/rand()
(rand()
yields supposedly uniformly distributed numbers between −1 and 1).
pgfmath
doesn't do what you think it does. When\pgfmathparse
is used, all variables used in the expression must be known. When it sees a division, the divisor is known. If this divisor is 0,\pgfmath
issues the error you've pasted. So, with your notations, for a givenx
, it can tell you whetherf(x)
can be computed; but it can't reasonably give you all values ofx
for whichf(x)
can be computed. Mathematically, it would have to check all of R (assuming we are working on R), which is uncountable. Inpgfmath
, the number of possiblef(x) = 1/rand()
(rand()
yields supposedly uniformly distributed numbers between -1 and 1).pgfmath
do and returns that error. i.e. What conditions does it check for this error?