Dear Julians.
I was testing the following code (M,C and K are sparse, symmetric and positive definite matrices)
Julia> M,C,K=THS();
julia> cholM=cholesky(M);
julia> Cb = cholM\C;
julia> Kb = cholM\K;
julia> F = 0.5*(Array(Cb) + sqrt(Array(Cb^2 - 4*Kb)));
julia> norm(F^2 - F*Cb + Kb)
Using Julia-dev Version 1.12.0-DEV.317 Commit 0e28cf6abf (2024-04-08 10:46 UTC)
or Julia Version 1.11.0-alpha2 Commit 9dfd28ab751 (2024-03-18 20:35 UTC)
gives a reasonable value
1.0530104604285245e-5
but using julia 1.9 (installed using juliaup in a Linux (Fedora 39) machine gives
7.606244293550662e52
a very weird result.
More detailed data about the versions
julia> versioninfo()
Julia Version 1.12.0-DEV.317
Commit 0e28cf6abf (2024-04-08 10:46 UTC)
Platform Info:
OS: Linux (x86_64-redhat-linux)
CPU: 12 × 12th Gen Intel(R) Core™ i5-1235U
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 12 virtual cores)
Environment:
JULIA_EDITOR = code
and
julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 12 × 12th Gen Intel(R) Core™ i5-1235U
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
Threads: 1 on 12 virtual cores
Environment:
JULIA_EDITOR = code
It does not happen for small, dense, matrices. So I guess is something related to numerical stability of computing the sqrt.
Matrices are 2200 x 2200
K
C = 1E-6*K
M
Does anyone can give me some light regarding what may be the cause for this difference?
Thank you!