The shape of a formation may be interpreted as either circular or rectangular for pressure transient analysis. However, in many practical situations, the reservoir drainage shape is too complicated to be approximated by a circular or rectangular shaped system. Thus, there is a need for the development of a method to predict transient pressure response in irregularly shaped reservoirs. Because it is difficult to superpose the line-source solution of image wells in space for irregular drainage shapes, a solution using the method of superposition in time is used to simulate the effects of the actual solution, which consists of infinitely many image wells. However, the use of superposition in time is extremely time-consuming even for fast computers because of the numerous evaluations of the Ei function. This paper presents an algorithm which avoids the evaluation of the Ei function by taking its derivative, resulting in an algorithm which is at least 80 times faster than the one presented before. This advancement allows this method to be implemented in personal computers, which now can be used readily on site. This paper describes the algorithm in detail and presents its source code in MATLAB.