Skip to content

Commit 27ea9c2

Browse files
committed
expm1 special case change
For `inf` real part and finite, nonzero imaginary part, now guaranteed to be (+/-`inf`, +/-`inf`), with cosine and sine of the imaginary part determining the sign, respectively
1 parent 64282d6 commit 27ea9c2

File tree

1 file changed

+2
-1
lines changed
  • dpctl/tensor/libtensor/include/kernels/elementwise_functions

1 file changed

+2
-1
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/expm1.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ template <typename argT, typename resT> struct Expm1Functor
8585
return in;
8686
}
8787
else {
88-
return (x * resT{std::cos(y), std::sin(y)});
88+
return (resT{std::copysign(x, std::cos(y)),
89+
std::copysign(x, std::sin(y))});
8990
}
9091
}
9192
else {

0 commit comments

Comments
 (0)