Improved handling of trig functions on intervals that exactly begin at a local extreme.
Improved documentation.