Hi all,
If I have a continuous function that is nonsmooth at k points and a discontinuous function with k jump discontinuities, all else being equal and using 'splitting','on' for both, I often see that it is noticeably cheaper for Chebfun to approximate the discontinuous function in terms of total number of function evaluations. I've attached a simple demo based on abs(sin(x)) to demonstrate this; just run nonsmoothVsJumps(k), say, with k=10.
Is this behavior expected, that handling jumps are somehow easier for Chebfun than nonsmooth points? If it is indeed true, I imagine the reason might be that detecting jump discontinuities is easier than detecting discontinuities in the first derivative, and so good split points for jumps can be found with less effort, which would lower the overall cost. Nevertheless, I was initially a bit surprised by this, so I'm curious if anyone can elaborate on what is really going on.
Thanks in advance,
Tim