You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on some code that uses LinearSolve and I ran into a strange behavior depending on OS.
using LinearSolve
using DelimitedFiles
A =readdlm("A.txt")
b =readdlm("b.txt")
prob = LinearSolve.LinearProblem(A, b)
c = LinearSolve.solve(prob)
A has a determinant -2.4703845333287813e-50. On macos, the code above produces an answer, on a Linux machine I get a singularity error. Why is the behavior so different?
That's not strange. Different BLAS implementations, which will change depending on the OS, will use different SIMD vector lengths and summation orders. Changes to multithreading will also change multithreading. Because floating point arithmetic is not associative, that will lead to differences (based on the condition number of the matrix). -2.4703845333287813e-50 is just indiscernibly close to zero with 64-bit floating points.
I have been working on some code that uses LinearSolve and I ran into a strange behavior depending on OS.
A
has a determinant -2.4703845333287813e-50. On macos, the code above produces an answer, on a Linux machine I get a singularity error. Why is the behavior so different?The input files are here:
A.txt
b.txt
The text was updated successfully, but these errors were encountered: