Padé approximation is the best rational function that approximates a function.
Formulated in the following equation:
It can also be written like this:
When the coefficients are obtained in the Maclaurin series as follows:
With the following constraints:
Each coefficient is uniquely determined.
It is equivalent to solving the following simultaneous equations.
See below for an example implementation.
Since this is a calculation that produces many digit loss, the double precision does not produce the expected results.
MultiPrecisionCurveFitting