# Fast solving of a cubic equation?

**URL:** <https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779>\
**Category:** Specific Domains\
**Created:** [November 6, 2019, 5:38am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779 "2019-11-06T05:38:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [November 6, 2019, 5:38am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/1 "2019-11-06T05:38:34Z")

</div>

i just want to know if of all the existing polynomial root solving packages, there is one that solves cubic equations with the exact formula (cardano’s method)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [November 6, 2019, 5:42am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/2 "2019-11-06T05:42:38Z")

</div>

> [@longemen3000](#):
>
> i just want to know if of all the existing polynomial root solving packages,

yes [GitHub - giordano/PolynomialRoots.jl: Fast complex polynomial root finder, with support for arbitrary precision calculations](https://github.com/giordano/PolynomialRoots.jl)

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [November 6, 2019, 5:48am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/3 "2019-11-06T05:48:03Z")

</div>

i was looking at the source code an there it was, xD

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [November 6, 2019, 5:52am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/4 "2019-11-06T05:52:08Z")

</div>

from the code, the cubic solver isn’t called when using the `roots` function, but the method is here, and thats all i need to know

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [November 6, 2019, 6:05am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/5 "2019-11-06T06:05:35Z")

</div>

> [@longemen3000](#):
>
> cardano

does it not call? [https://github.com/giordano/PolynomialRoots.jl/blob/196154b7ff97e4310509e1e32290cc80aad83d65/src/PolynomialRoots.jl#L655](https://github.com/giordano/PolynomialRoots.jl/blob/196154b7ff97e4310509e1e32290cc80aad83d65/src/PolynomialRoots.jl#L655)

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [November 6, 2019, 6:07am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/6 "2019-11-06T06:07:31Z")

</div>

from the readme:

> `roots` can be used to solve polynomials of any degree, `roots5` is tailored to (and works only for) polynomials of degree 5.

the call is in `root5`, not in `roots`, but anyway, i used that function directly

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [November 6, 2019, 6:09am UTC](https://discourse.julialang.org/t/fast-solving-of-a-cubic-equation/30779/7 "2019-11-06T06:09:16Z")

</div>

ah, I see what you mean, the `solve_cubic_eq` routine is not used unless `roots5` is called.
