Articles | Volume 3, issue 2
https://doi.org/10.5194/gmd-3-329-2010
https://doi.org/10.5194/gmd-3-329-2010
23 Jul 2010
 | 23 Jul 2010

Efficient approximation of the incomplete gamma function for use in cloud model applications

U. Blahak

Abstract. This paper describes an approximation to the lower incomplete gamma function γl(a,x) which has been obtained by nonlinear curve fitting. It comprises a fixed number of terms and yields moderate accuracy (the absolute approximation error of the corresponding normalized incomplete gamma function P is smaller than 0.02 in the range 0.9 ≤ a ≤ 45 and x≥0). Monotonicity and asymptotic behaviour of the original incomplete gamma function is preserved.

While providing a slight to moderate performance gain on scalar machines (depending on whether a stays the same for subsequent function evaluations or not) compared to established and more accurate methods based on series- or continued fraction expansions with a variable number of terms, a big advantage over these more accurate methods is the applicability on vector CPUs. Here the fixed number of terms enables proper and efficient vectorization. The fixed number of terms might be also beneficial on massively parallel machines to avoid load imbalances, caused by a possibly vastly different number of terms in series expansions to reach convergence at different grid points. For many cloud microphysical applications, the provided moderate accuracy should be enough. However, on scalar machines and if a is the same for subsequent function evaluations, the most efficient method to evaluate incomplete gamma functions is perhaps interpolation of pre-computed regular lookup tables (most simple example: equidistant tables).