I want to approximate
tanh
by a low-degree rational function of form
r
(
x
)
Sylvia Byrd
Answered question
2022-07-04
I want to approximate by a low-degree rational function of form
such that the norm over the fixed interval is small:
That is, I would like to solve for the coefficients . Note that and . I don't know where to begin, so I'm looking for suggestions on how to approach this problem; pointers to relevant numerical methods would also be greatly appreciated
Answer & Explanation
Camron Herrera
Beginner2022-07-05Added 16 answers
Not an answer but too long for a comment. An analytical expression of the norm seems very difficult (not to say impossible). What I would suggest is to built the Padé approximant of around . This would give
Trying for and
seems to be already decent. For the same problem, a full optimization would give
May be, you could use the sum of these Padé approximants each of them being built for a short interval. Edit: The key problem is that we cannot have even an explicit solution for
There is one thing you could try taking into account the fact that the Padé approximant is . Let
and define the norm
developing the integrand, we have terms in (no problem with these) and a series of integrals
They do not make much problems
and
So, we have all the elements. Now solve
which makes a linear system of four equations for four unknowns. So, we have the series expansion that we could transform as a Padé approximant around the midpoint with
This procedure has been tried with , , . Using the original Padé approximant leads, for the norm, to a value equal to . The optimization of the series gives . The new Padé approximant leads to . Much work for a more than bad result.
rzfansubs87
Beginner2022-07-06Added 5 answers
Here is a (bad!) attempt. First, suppose without loss of generality that , and define
then expanding the optimality conditions we obtain
where for a fixed value of such that , the above becomes a system of 3 equations in . If we can precompute a discretization of for different values of , then we may search over the combination of coefficients that approximately minimizes the norm.