Skip to content

*trsm: remove zero-RHS skip for consistent NaN on singular matrix#1301

Merged
langou merged 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue636
Jul 9, 2026
Merged

*trsm: remove zero-RHS skip for consistent NaN on singular matrix#1301
langou merged 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue636

Conversation

@jschueller

Copy link
Copy Markdown
Collaborator

The left-solving non-transposed path in DTRSM/S/CTRSM/ZTRSM has an optimization that skips the division B(K,J)/A(K,K) when B(K,J) is exactly zero. When A(K,K) is also zero (singular matrix), this leaves B(K,J)=0 instead of computing 0/0=NaN, producing inconsistent results across different calling variants of the same triangular solve.

Closes #636

The left-solving non-transposed path in DTRSM/S/CTRSM/ZTRSM has an
optimization that skips the division B(K,J)/A(K,K) when B(K,J) is
exactly zero. When A(K,K) is also zero (singular matrix), this
leaves B(K,J)=0 instead of computing 0/0=NaN, producing inconsistent
results across different calling variants of the same triangular
solve.

Closes Reference-LAPACK#636
@langou langou merged commit 6840252 into Reference-LAPACK:master Jul 9, 2026
11 of 12 checks passed
@jschueller jschueller deleted the issue636 branch July 9, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DTRSM inconsistent behavior with zeros on the diagonal and an all-zero right-hand side

2 participants