We present LinApart, a routine designed for efficiently performing the univariate partial fraction decomposition of large symbolic expressions. Our method is based on an explicit closed formula for the decomposition of rational functions with fully factorized denominators. We provide an implementation in the Wolfram Mathematica language, which can lead to very significant performance gains over the built-in Apart command. Furthermore, a C language library implementing the core functionality and suitable for interfacing with other software is also provided. Both codes are made available at https://github.com/fekeshazy/LinApart.Program summaryProgram title:LinApartCPC Library link to program files:https://doi.org/10.17632/v8vg2mjjnb.1Developer's repository link:https://github.com/fekeshazy/LinApartLicensing provisions: MIT licenseProgramming language:Wolfram Mathematica and CNature of problem: Analytic computations in quantum field theory often produce large expressions involving complicated rational functions. In many cases, such as symbolic integration, performing partial fraction decomposition of the latter is vital. Even though univariate partial fraction decomposition is conceptually well-understood, the complexity of state-of-the-art calculations is such that use of readily available tools, such as the Apart command in Mathematica, becomes highly impractical due to time and memory constraints. Here we present LinApart, a routine developed for performing univariate partial fraction decomposition in a highly efficient manner. Improvements in timing and memory usage of up to five orders of magnitude are achieved for rational expressions with as few as ten denominator factors. As such, the routine allows to perform decomposition problems that were previously intractable.Solution method: The LinApart routine implements a simple closed form expression for univariate partial fraction decomposition of rational functions with fully factored denominators based on the residue theorem. The Mathematica implementation makes use of the highly efficient built-in differentiation routine to evaluate this formula. The C language implementation employs a version of the formula that does not require symbolic differentiation but is rather based on the computation of multinomial coefficients.Additional comments including restrictions and unusual features: The routine is based on a formula which assumes that the denominator of the rational function to be decomposed is in a fully factorized form, i.e., it is a product whose factors are linear in the decomposition variable. For maximum efficiency, the Mathematica implementation by default does not perform any factorization and non-linear denominators, if present, are simply disregarded during the decomposition. Thus, in such cases the output will not be in a fully decomposed form. This issue does not arise in the C implementation, which only accepts linear denominator factors of the form (x−a)m as input.
Read full abstract