For details of method please google the article entitled "An Easy Efficient Pure Algebraic Method for Partial Fraction Expansion of Rational Functions with Multiple High-Order Poles" by Youneng MA, Jinhua YU and Yuanyuan WANG. The article is submmitted to IEEE Circuits and systems I. Those who use the code please cite the article and clarify the source.
The method is efficient in most cases of partial fraciton exansion.
However,as the round-off errors are inevitable and those errors will grow with the scale of problem and be enlarged if a rational functions contain ill-conditioned poles, our method will lose its accuracy when dealing with some tricky large scale problems. To achieve better results in such problems, it is advisable to choose the value of s0 carefully and to rearrange the input-order of the poles. Practically, s0 can be one of the normal poles (except the ill-conditioned poles) or s0 should neither too near nor too far away from the poles. In terms of the input-order, if a pole has smaller residues when the numerator is a constant (namely, this pole’s c0ij is smaller by our notation in the article), we should input it first. This may help improve accuracy to large extent in many cases.