Skip to content

Fix sine calculation in scaled CROTG/ZROTG - #6270

Merged
martin-frbg merged 1 commit into
OpenMathLib:developfrom
wonwondogs:fix-complex-rotg-scaled-phase
Nov 22, 2026
Merged

martin-frbg merged 1 commit into
OpenMathLib:developfrom
wonwondogs:fix-complex-rotg-scaled-phase

Conversation

@wonwondogs

Copy link
Copy Markdown
Contributor

Summary

  • Restore the sign of the imaginary cross term in the scaled CROTG/ZROTG path. For a = 2^k and b = (1+i)2^k, the old code returned s = (1+i)/sqrt(3) instead of (1-i)/sqrt(3).
  • Correct the real cross term in the adjacent scaled branch. For a = 2^300(1+i) and b = 2^600(1+i), the old code returned s = 0 instead of s ≈ 1.
  • Add regression tests for single and double precision through both the Fortran and CBLAS entry points.

Fixes #6269.

Testing

  • The new cases fail before the corresponding fixes and pass afterward.
  • make -j1 TARGET=VORTEXM4 NOFORTRAN=1 NO_LAPACK=1 NO_SHARED=1: 159 core tests and 1514 extension tests passed.

@martin-frbg martin-frbg added this to the 0.3.35 milestone Nov 22, 2026
@martin-frbg

Copy link
Copy Markdown
Collaborator

Thank you. (Glad that my old math teacher can't see this)

@martin-frbg
martin-frbg merged commit f80d6e8 into OpenMathLib:develop Nov 22, 2026
15 of 23 checks passed
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.

CROTG/ZROTG return wrong sine phase for scaled complex inputs after #6123

2 participants