Repository navigation
Preserve imaginary sign in complex tan overflow handling - #1434
Closed
agourakis82 wants to merge 1 commit into
Closed
agourakis82 wants to merge 1 commit into
agourakis82 wants to merge 1 commit into
Conversation
agourakis82
marked this pull request as ready for review
October 28, 2026 09:10
DiamonDinoia
approved these changes
Nov 5, 2026
DiamonDinoia
left a comment
Contributor
There was a problem hiding this comment.
Same here it seems okay. But needs a rebase
agourakis82
force-pushed
the
fix/complex-tan-overflow-sign-1432
branch
2 times, most recently
from
November 6, 2026 06:34
230dfd0 to
17bef76
Compare
DiamonDinoia
requested changes
Nov 10, 2026
DiamonDinoia
left a comment
Contributor
There was a problem hiding this comment.
I think the feedback from before Applies here too.
Fix looks fine but tests are overly complicated.
Think on how to populate batches with real-im pair (is fine to overtest 64 combinations) instead of 20 handpicked ones where you generate the combinations. Then you iterate in a simd and normal scalr fashion and check against std.
Check if you need fast math checks for this test or if it passes with and without. It is fine to test some more cases.
Please, apply this feedback to all the PRs.
Contributor
Author
|
Sure!! Thanks for the support and patience!!! |
When sinh(2*imag(z)) overflows, keep that sign on the saturated imaginary part.
cursor
Bot
force-pushed
the
fix/complex-tan-overflow-sign-1432
branch
from
November 11, 2026 00:09
17bef76 to
f8c5c5c
Compare
Contributor
|
Superseded by #1456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Complex tan used to saturate the imaginary part to +1 whenever
sinh(2*imag(z))overflowed, sotan(1, -45)andtan(1, -356)came back with a positive imaginary part. The non-fast-math path now copies the sign of that overflow onto the saturated one. The test fills an 8 by 8 real/imaginary grid, including those magnitudes and signed zeros, and compares each batch withstd::tan. The grid is left out of fast-math builds, where this recovery is not compiled and the kernel does not matchstd::tan.Part of #1432.
Written by me with AI assistance.