# Calculating a pade approximant?

**URL:** <https://discourse.julialang.org/t/calculating-a-pade-approximant/74060>\
**Category:** General Usage\
**Created:** [January 4, 2022, 8:57pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060 "2022-01-04T20:57:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [January 4, 2022, 8:57pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/1 "2022-01-04T20:57:12Z")

</div>

I’m assuming this must be hiding in a library somewhere…

I found a pade appoximant evaluation in the Polynomials package, but it doesn’t look like there is any functionality for generating an approximant for an arbitrary function.

Any suggestions ?

---

<div class="post-metadata">

**Author:** ![brianguenter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brianguenter/32/29519_2.png) [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Post date:** [January 4, 2022, 9:47pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/2 "2022-01-04T21:47:50Z")

</div>

This may not be exactly what you are looking for but maybe it’s in the ballpark: [macd/BaryRational.jl: Barycentric rational approximation and interpolation in one dimension. (github.com)](https://github.com/macd/BaryRational.jl)

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [January 4, 2022, 9:49pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/3 "2022-01-04T21:49:58Z")

</div>

it absolutely is in the ballpark. thank you !

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [January 4, 2022, 9:50pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/4 "2022-01-04T21:50:24Z")

</div>

Also, you should check out Remez.jl which can give minimax rational approximations.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [January 4, 2022, 9:55pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/5 "2022-01-04T21:55:29Z")

</div>

that looks useful too. one thing i’m currently trying to figure out is if the algorithm i’m trying to implement requires a Pade approximation in particular or any rational approximation.

i suspect that the paper referred to Pade approximants simply becaus they are well known and well understood.

That was the other reason to ask, i was wondering if someone might also chime in with “you may think you want to use Pade, but you really want to use X instead”.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 5, 2022, 3:09am UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/6 "2022-01-05T03:09:52Z")

</div>

> [@Oscar\_Smith](#):
>
> Also, you should check out Remez.jl which can give minimax rational approximations.

Padé is pretty different from minimax rational approximants — the latter are approximating a function on an _interval_, whereas Padé is essentially an extrapolation method or series acceleration.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [January 5, 2022, 3:16am UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/7 "2022-01-05T03:16:42Z")

</div>

Yeah, but a lot of people use pade when they only care about an interval even though it’s really sub-optimal.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [January 5, 2022, 8:07pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/8 "2022-01-05T20:07:40Z")

</div>

I was reading the paper of interest last night, and it does seem that the method i’m investigating requires pade approximants. Even though, technically, it’s trying to approximate on an interval, the idea is that the approximation holds on as wide an interval as possible, for the obvious reason that it allows a larger step in the solution calculation.

There’s an example in the paper i have to work through, but I think i really do want to calculate the pade approximation.

it doesn’t look to terrible, so i’ll give it a try and see if it works out.

seems like it would be a useful addition to a library of some sort, maybe even symbolics. would be very slick to be able to put in the function algebraicly and have it calculate the m,n pade approximation for you via calculating the derivatives symbolically.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 5, 2022, 9:07pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/9 "2022-01-05T21:07:55Z")

</div>

The following github references might be of interest too, with Julia code `using SymPy`:

- [computing the R[2/2] Pade Approximant of exp(x)](https://github.com/J-Revell/Wynn.jl#further-usage-computing-the-r22-pade-approximant-of-expx)
- [Pade.jl](https://github.com/J-Revell/Pade.jl/blob/master/src/Pade.jl)

---

<div class="post-metadata">

**Author:** ![richinex](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/richinex/32/43805_2.png) [@richinex](https://discourse.julialang.org/u/richinex)\
**Post date:** [November 15, 2022, 12:41pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/10 "2022-11-15T12:41:33Z")

</div>

Hi @purplishrock , where you able to find a convenient way/library to generate an approximant for any arbitrary function. I am also interested in this.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [November 16, 2022, 10:27pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060/11 "2022-11-16T22:27:03Z")

</div>

No, I got sidetracked on a different (although related) project.

However I was just going through the very paper I mentioned in this thread about 3 or 4 days ago and was going to start up work on it again. What a coincidence.

The other project which sidetracked me was very much related to this subject and I think i have a better handle on the math involved.

Hence the reason I’m going to give it another try.

I sure hope I don’t get sidetracked again…
