## Padé approximation - usability in iterative algorithms

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

Firstly, I have to say that I don't understand Padé approximation well.
But I discovered that, it is more precise than Taylor series.
I have to create approximation for these functions: Log(x) and Tanh. And I have to create iterative algorithms (I must compute result with variable precision).

So my questions are:
Is Padé approximation usable (and more efficient than simple Taylor series) for this task?
If no, is there any better way to approximate these functions?

-

## 1 Answer

A qualitative reason for using rational approximations (e.g. Padé) instead of polynomial ones (e.g. Taylor) is that rational approximations can exhibit behavior (e.g. poles and asymptotes) that polynomials are hard-pressed to emulate; they thus tend to be slightly more accurate (there are always exceptions, though).

What you can do that is equivalent to using a Padé approximant (SFAICT, there's no simple method for generating the coefficients of the numerator and denominator polynomials for the two functions you have, except by solving the appropriate Toeplitz system) is to use continued fraction expansions, which $\ln(1+x)$ and $\tanh(x)$ have by their virtue of being expressible as hypergeometric functions.

Of course, for proper use, you have to perform appropriate argument reductions (e.g. for $\tanh$, compute $x^{\star}=\frac{x}{2^n}$ where $n$ is an appropriate integer such that $x^{\star}$ is "small" enough, evaluate the continued fraction at $x^{\star}$, and use the double-argument formula for $\tanh$ to undo your previous transformation).

For evaluating continued fractions, a (reasonably) robust way of going about it is to use the "modified Lentz method" due to Lentz, Thompson, and Barnett; the algorithm's details are in Numerical Recipes or Gil/Segura/Temme's Numerical Evaluation of Special Functions.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 8, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9153637290000916, "perplexity_flag": "middle"}