Gallager\´s exponent function

plays a crucial role in the derivation of bounds for coding error probabilities. An iterative algorithm for computing the maximum of

over the set of input probability distributions is presented. The algorithm is similar to that of Arimoto and Blahut for computing channel capacity. It is shown that the approximation error is at most inversely proportional to the number of iterations. A similar iterative algorithm for computing the source code reliability-rate function also is presented.