Digital Distortion effect algorithm
Thanks to the plot in Olli Niemitalo's answer I got convinced that the formula given in the book has a sign error. The non-linearity used for fuzz or distortion is always some type of smoothed clipping function, which compresses the input signal. So small input amplitudes experience little change whereas high input amplitudes are (more or less) softly clipped. And the figure shown in Olli's answer does exactly the opposite.

So I'm convinced that the correct formula should be

$$f(x)=\frac{x}{|x|}\left(1-e^{-x^2/|x|}\right)=
\text{sgn}(x)\left(1-e^{-|x|}\right)\tag{1}$$

For small values of $x$ we have $f(x)\approx\text{sgn}(x)|x|=x$, and for large (magnitude) values we get $f(x)\approx\text{sgn}(x)$, i.e., clipping.

This is a plot of the corrected non-linearity $f(x)$ (WolframAlpha):



The formula should also be simplified like the right-most expression in $(1)$, because a beginner might be inclined to literally implement the other formula and try to evaluate the terms $x/|x|$ and $x^2/|x|$, which is unnecessarily complex and also gives trouble when $x$ is close to zero. A typical implementation would look like this:


if (x > 0)
   y = 1 - exp(-x);
else
   y = -1 + exp(x);
end