Skip to content

Conversation

@steffenlarsen
Copy link
Contributor

The current implementation of the tanh function for the SYCL complex extension did not always return values precise enough, neither on device nor on host. This was caused by accumulated error from a call to cos. This commit changes the implementation of tanh to use a different way of calculating the result and tests it against std::tanh for complex numbers.

@sarnex
Copy link
Contributor

sarnex commented Nov 13, 2025

@steffenlarsen Sorry, please rebase on top of HEAD before re-running WIndows CI, it has a fix to prevent breaking Windows build runners. Thanks

The current implementation of the tanh function for the SYCL complex
extension did not always return values precise enough, neither on
device nor on host. This was caused by accumulated error from a call
to cos. This commit changes the implementation of tanh to use a
different way of calculating the result and tests it against std::tanh
for complex numbers.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@steffenlarsen
Copy link
Contributor Author

Friendly ping, @intel/llvm-reviewers-runtime (@cperkinsintel)

@steffenlarsen steffenlarsen merged commit 3008955 into intel:sycl Nov 24, 2025
63 of 68 checks passed
@steffenlarsen steffenlarsen deleted the steffen/fix_tanh branch November 24, 2025 07:55
luszczewskakasia1 pushed a commit to luszczewskakasia1/llvm that referenced this pull request Nov 28, 2025
The current implementation of the tanh function for the SYCL complex
extension did not always return values precise enough, neither on device
nor on host. This was caused by accumulated error from a call to cos.
This commit changes the implementation of tanh to use a different way of
calculating the result and tests it against std::tanh for complex
numbers.

---------

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
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.

3 participants