Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This avoids the issues as in JuliaLang/LinearAlgebra.jl#1093 and JuliaLang/LinearAlgebra.jl#1092 where we compare small numbers using a relative tolerance. Also, in this PR, I have added an extra test, so now we compare both
A * B * alpha + C * beta
andA * B * alpha - C * beta
with the corresponding in-place versions. The idea is that if the termsA * B * alpha
andC * beta
have similar magnitudes, at least one of the two expressions will usually result in a large enough number that may be compared using a relative tolerance.I am unsure if the
atol
chosen here is optimal, as I have ballparked it to use the maximumeps
by looking at all theeltype
s involved.Fixes JuliaLang/LinearAlgebra.jl#1093
Fixes JuliaLang/LinearAlgebra.jl#1092