# \`isposdef\` inconsistent results, numerically unstable?

**URL:** <https://discourse.julialang.org/t/isposdef-inconsistent-results-numerically-unstable/9013>\
**Category:** Numerics\
**Tags:** bug\
**Created:** [February 12, 2018, 1:49pm UTC](https://discourse.julialang.org/t/isposdef-inconsistent-results-numerically-unstable/9013 "2018-02-12T13:49:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 12, 2018, 2:01pm UTC](https://discourse.julialang.org/t/isposdef-inconsistent-results-numerically-unstable/9013/2 "2018-02-12T14:01:31Z")

</div>

I thought I just mentioned it here:

> [@Approximate equality](https://discourse.julialang.org/t/approximate-equality/8952):
>
> I read somewhere that the approximation binary operator (\approx) checks if the number is within machine precision. Whatever it does exactly, it does not appear to behave consistently: julia\> ℯ^(-π\*im) -1.0 - 1.2246467991473532e-16im julia\> ℯ^(-π\*im) == -1 false This is probably normal behaviour, and I guess that \sim 10^{-16} is machine or type precision. So I will use \approx to get a trueth, but reordening of symbols, or considering only the imaginary part, results in a falsehood: julia\>…

But I guess not. Order of operations matters when taking into account floating point error. Multithreading can change the order of operations, making the multithreaded results stochastic in the last few values due to changing floating point error. I’m not sure what `eigs` is calling but I would assume that’s what’s happening here.

> [@mohamed82008](#):
>
> And finding the whole eigenvalue decomposition is overkill.

I would’ve suggested iterative solvers, but they find the eigenvalues in the other order…

---

_[View the full topic](https://discourse.julialang.org/t/isposdef-inconsistent-results-numerically-unstable/9013)._
