Approximation by piecewise exponentials