Algorithmic differentiation for piecewise smooth functions: a case study for robust optimization. (2nd November 2018)