Skip to content

Commit 427f4ca

Browse files
committed
[SYCL] Fix corner cases in libdevice impl for complex exp
Signed-off-by: jinge90 <[email protected]>
1 parent 573470f commit 427f4ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libdevice/cmath_wrapper_fp64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ short _Exp(double *px, double y,
394394
_Dconst _Inf = {INIT(_DMAX << _DOFF)};
395395
short ret = 0;
396396
if (*px < -HUGE_EXP || y == 0.0) // certain underflow
397-
*px = 0.0;
397+
*px = __spirv_ocl_copysign(0.0, y);
398398
else if (HUGE_EXP < *px) { // certain overflow
399-
*px = _Inf._Double * (y < 0.F ? -1.F : 1.F);
399+
*px = __spirv_ocl_copysign(_Inf._Double, y);
400400
ret = _INFCODE;
401401
} else { // xexp won't overflow
402402
double g = *px * invln2;

0 commit comments

Comments
 (0)