We provide theoretical error bounds for the accurate numerical computation of the quantile function given the characteristic function of a continuous random variable. We show theoretically and empirically that the numerical error of the quantile function is typically several orders of magnitude larger than the numerical error of the cumulative distribution function for probabilities close to zero or one. We introduce the COS method for computing the quantile function. This method converges exponentially when the density is smooth and has semi-heavy tails and all parameters necessary to tune the COS method are given explicitly. Finally, we numerically test our theoretical results on the normal-inverse Gaussian and the tempered stable distributions.