# Wrong results in calculation

**URL:** <https://discourse.julialang.org/t/wrong-results-in-calculation/21567>\
**Category:** Performance\
**Created:** [March 7, 2019, 12:14pm UTC](https://discourse.julialang.org/t/wrong-results-in-calculation/21567 "2019-03-07T12:14:24Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [March 12, 2019, 1:52am UTC](https://discourse.julialang.org/t/wrong-results-in-calculation/21567/21 "2019-03-12T01:52:14Z")

</div>

Since Magma isn’t open source, we don’t really know. If someone does know and wants to share that information, it would be good to hear about.

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [March 12, 2019, 8:21pm UTC](https://discourse.julialang.org/t/wrong-results-in-calculation/21567/22 "2019-03-12T20:21:12Z")

</div>

> [@Jean\_Michel](#):
>
> The only thing I can tell is that they do not have a special algorithm for Hilbert matrices, the speedup is observed for all Rational matrices…

This could also be due to Julia’s rationals being unnecessary slow. There are a couple of things that could be done here:

- Reduce calls to `gcd` ([#11522](https://github.com/JuliaLang/julia/issues/11522)).
- Use `mpq` functions for `Rational{BigInt}` operations ([#9826](https://github.com/JuliaLang/julia/issues/9826)).

[Previous page](https://discourse.julialang.org/t/wrong-results-in-calculation/21567.md?page=1)
