Complex Function Grapher

The Trouble With 0

A Static Image (not a live applet)
One referee tried something neither I nor my students had ever experimented with. He or she graphed the function log(z^2)-2*log(z), as illustrated on the right. As the referee reported, this function "produced peculiarities." The "pecularities" are caused by roundoff error and the extreme sensitivity of the argument for values near 0. After all, while 10-15+0i and 0+10-15i are each within reasonable roundoff error of 0, their arguments are quite different; arg(10-15+0i)=0 and arg(0+10-15i)=pi/2. Note that this effect is independent of the precision, so it can't be solved by simply increasing the precision. In the case of f(z)=log(z^2)-2*log(z), we have f(z)=0 for all Re(z)>0. When plotted (in side view), this correctly graphs as a flat plane for Re(z)>0 (since the modulus is within roundoff error of 0), but the arguments are nearly random because of the roundoff error in the calculation. This means the colors will have an interesting pattern of dots. Of course, in top view all you will see will be the colors, which makes it even seem even more "peculiar."

I tried using the color gray for all values with sufficiently small modulus to avoid this difficulty. Unfortunately, this led to a different set of graphs having peculiar properties (if you tried to zoom in on a graph of f(z)=z^3 for example, you would get a large gray blob in the center rather than a triple set of colors). I decided that it was better to avoid using gray, both because I was more interested in having my students look at the behavior of polynomials near roots, and because if it ever came up (none of my students has tried these examples), the discussion of the sensitivity of the argument function would be educational.

Return to Complex Function Grapher


Please report any problems with this page to bennett@math.ksu.edu
©2001 Andrew G. Bennett