Skip to content

Use paired sin_cos in the complex from_polar helpers - #89

Closed
marknefedov wants to merge 1 commit into
dimforge:masterfrom
marknefedov:paired-sin-cos
Closed

Use paired sin_cos in the complex from_polar helpers#89
marknefedov wants to merge 1 commit into
dimforge:masterfrom
marknefedov:paired-sin-cos

Conversation

@marknefedov

@marknefedov marknefedov commented Aug 14, 2026

Copy link
Copy Markdown

complex_from_polar and the three SIMD backends' simd_complex_from_polar call sine and cosine separately on the same angle, running the argument reduction twice. This switches them to a single sin_cos / simd_sin_cos call. These helpers sit under complex exp, sqrt, powf and powc.

Possible last-bit differences on backends whose fused sin_cos differs from separate calls. Withdrawn: no measured numbers for this path.

complex_from_polar and the three SIMD backends' simd_complex_from_polar
called sine and cosine separately on the same angle, performing the
argument reduction twice. They now call sin_cos / simd_sin_cos once and
use both outputs. This feeds complex exp, sqrt, powf and powc.
@marknefedov

Copy link
Copy Markdown
Author

Closing this: I benchmarked the related lane-access change and couldn't demonstrate a measurable win for this family of tweaks, so I'm withdrawing the unmeasured ones rather than asking for review time on speculation. Can reopen with numbers if I get around to benchmarking the complex-math paths.

@marknefedov
marknefedov deleted the paired-sin-cos branch August 14, 2026 21:05
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.

1 participant