chebfun/chebfun — pull request #1088 by trefethen (2014-07-27 13:20:39+00:00)
Title: Fix simplify

In our group meeting on 16 July 2014, we agreed to change `simplify` so that, as in v4, it chops off a tail of small coefficients but does not zero small coefficients in the interior of the Chebyshev or Fourier series. This interior zeroing behavior had led to very confusing results when one inspected series coefficients, without a very clear benefit. I have now changed `@chebtech/simplify` and `@fourtech/simplify` accordingly, as well as a few Chebfun tests that were affected either because they explicitly tested for zeroing of coefficients in the interior or because of essentially accidental failures.

This change will affect (making their output more comprehensible) three Chebfun Examples: `cheb/ChebyshevCoeffs`, `approx/FourierCoefficients`, and `approx/FourierBasedChebfuns`.
A simple command whose output is affected is
```
plotcoeffs(chebfun('exp(x)./(1+1000*x.^2)'))
```

People who were in our group discussion will recall that surprises in the output from `plotcoeffs` resulted from an interplay of (1) setting interior coefficients to zero, as addressed in this pull request, and (2) plotting zero coefficients as nonzero values, which I have not changed. There may still be a few plotting oddities, but I believe they can now be addressed if necessary as plotting oddities. Changing `simplify`, I hope, will take us most of the way towards more understandable behavior.

This is the first time I have touched the v5 code and the first time I have issued a pull request. I would be grateful if people would let me know if in any way I am not following procedures in the best way.

Below is a picture illustrating the effect of the new branch on the output of the `plotcoeffs` example above.

![fix-simplify](https://cloud.githubusercontent.com/assets/3601488/3714001/7d026efe-1590-11e4-9b58-a51d724c4367.png)