# Different results for cholesky decomposition between 0.6.2 and 0.6.3

**URL:** <https://discourse.julialang.org/t/different-results-for-cholesky-decomposition-between-0-6-2-and-0-6-3/11340>\
**Category:** General Usage\
**Tags:** linearalgebra\
**Created:** [June 1, 2018, 2:37pm UTC](https://discourse.julialang.org/t/different-results-for-cholesky-decomposition-between-0-6-2-and-0-6-3/11340 "2018-06-01T14:37:35Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Post date:** [June 2, 2018, 2:38am UTC](https://discourse.julialang.org/t/different-results-for-cholesky-decomposition-between-0-6-2-and-0-6-3/11340/6 "2018-06-02T02:38:07Z")

</div>

TL;DR: Small changes in the BLAS library will effect the order of operations, so there is no guarantee of identical results between minor Julia versions here.

Although your input matrix is exactly rank deficient, after a few manipulations it is perturbed, so we arrive at

> [@PSA: floating-point arithmetic](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678):
>
> Sometimes people are surprised by the results of floating-point calculations such as julia\> 5/6 0.8333333333333334 # shouldn't the last digit be 3? julia\> 2.6 - 0.7 - 1.9 2.220446049250313e-16 # shouldn't the answer be 0? These are not bugs in Julia. They’re consequences of the IEEE-standard 64-bit binary representation of floating-point numbers that is burned into computer hardware, which Julia and many other languages use by default. Brief explanation You can t…

By forming `A'A`, you make the situation worse (an almost-dependent vector could be obscured). Much more robust would be

```julia-auto
F=qrfact(A,Val{true})
ipermute!(abs.(diag(F[:R])) .> eps(10*size(A,1)*F[:R][1,1]), F[:p])

```

(The 10 is a fairly conservative tolerance factor.) Even this will fail in unusual cases, so you should check the effective rank with an SVD to be safe.

---

_[View the full topic](https://discourse.julialang.org/t/different-results-for-cholesky-decomposition-between-0-6-2-and-0-6-3/11340)._
