# Fast Legendre Transform?

**URL:** <https://discourse.julialang.org/t/fast-legendre-transform/68152>\
**Category:** Numerics\
**Tags:** question, package\
**Created:** [September 14, 2021, 3:29pm UTC](https://discourse.julialang.org/t/fast-legendre-transform/68152 "2021-09-14T15:29:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veenty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/veenty/32/50940_2.png) [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Post date:** [September 14, 2021, 3:29pm UTC](https://discourse.julialang.org/t/fast-legendre-transform/68152/1 "2021-09-14T15:29:07Z")

</div>

Is anyone aware of a package that is able to do a Fast Legendre Transform similar to the one in chebfun ([The fast discrete Legendre transform » Chebfun](https://www.chebfun.org/examples/cheb/FastDLT.html)).

The closest that I could find was something in FastTransform, where from the chebysheb mesh you generate (fast), the legendre coefficient. But that’s not quite what I need.

---

<div class="post-metadata">

**Author:** ![MikaelSlevinsky](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikaelslevinsky/32/38545_2.png) [@MikaelSlevinsky](https://discourse.julialang.org/u/MikaelSlevinsky)\
**Post date:** [September 15, 2021, 2:45pm UTC](https://discourse.julialang.org/t/fast-legendre-transform/68152/3 "2021-09-15T14:45:45Z")

</div>

You can use the inverse nonuniform FFT ([Home · FastTransforms.jl](https://juliaapproximation.github.io/FastTransforms.jl/dev/)) to convert Legendre samples to a Chebyshev series, then call `cheb2leg`.

Edit: The Gauss–Legendre points live in [GitHub - JuliaApproximation/FastGaussQuadrature.jl: Julia package for Gaussian quadrature](https://github.com/JuliaApproximation/FastGaussQuadrature.jl)

---

<div class="post-metadata">

**Author:** ![Michael965](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@Michael965](https://discourse.julialang.org/u/Michael965)\
**Post date:** [October 6, 2021, 11:44am UTC](https://discourse.julialang.org/t/fast-legendre-transform/68152/4 "2021-10-06T11:44:28Z")

</div>

I have also same issue any suggestion for this so please reply. Thanks in advance[.](https://www.skylightpaycard.run/)

---

<div class="post-metadata">

**Author:** ![Veenty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/veenty/32/50940_2.png) [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Post date:** [November 6, 2021, 7:13am UTC](https://discourse.julialang.org/t/fast-legendre-transform/68152/5 "2021-11-06T07:13:04Z")

</div>

Ok so I had read about the existence of an algorithm NlogN for the Legendre Transform, however it seems that it only is worth using for N \> 1000 or something like (in comparison to just use the Matrix multiplication strategy) and most likely if you need that many points, then the legendre polynomials where not a good basis to start from.
