8000
Skip to content

complex tan/tanh#5377

Open
bdeket wants to merge 4 commits intoracket:masterfrom
bdeket:tan-complex
Open

complex tan/tanh#5377
bdeket wants to merge 4 commits intoracket:masterfrom
bdeket:tan-complex

Conversation

@bdeket
Copy link
Copy Markdown
Contributor
@bdeket bdeket commented Nov 18, 2025

Prevent underflow in the calculation of complex-tan and complex-tanh

Although this improves the results in the affected regions, both have still inaccuracies up to 8ulp (real+imag)

closes #3324

continuing discussion there

Checklist

  • Feature
  • tests included

@bdeket bdeket marked this pull request as draft November 18, 2025 19:00
@bdeket bdeket changed the title complex tan/tanh [WIP] complex tan/tanh Jan 30, 2026
@bdeket
Copy link
Copy Markdown
Contributor Author
bdeket commented Jan 30, 2026

With this change maximum observed flulp-error is now 6 in my random testing.

Due to the mismatch of primitive functions exported by CS and BC, for tanh (in racket/math on CS) the code now transforms this in terms of tan (in CS) that transforms it back to tanh.
The alternative would be to bring the exports of BC in line with CS.

@bdeket bdeket marked this pull request as ready for review January 30, 2026 15:25
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.

improving tan of complex arguments

1 participant

0