diff --git a/src/device_util.cpp b/src/device_util.cpp index cd27ada4f5..8bba36c9c7 100644 --- a/src/device_util.cpp +++ b/src/device_util.cpp @@ -1267,108 +1267,6 @@ __device__ void __threadfence_system(void){ // no-op } -float __hip_host_erfinvf(float x) -{ - float ret; - int sign; - if (x < -1 || x > 1){ - return NAN; - } - if (x == 0){ - return 0; - } - if (x > 0){ - sign = 1; - } else { - sign = -1; - x = -x; - } - if (x <= 0.7) { - float x1 = x * x; - float x2 = std::fma(__hip_erfinva3, x1, __hip_erfinva2); - float x3 = std::fma(x2, x1, __hip_erfinva1); - float x4 = x * std::fma(x3, x1, __hip_erfinva0); - - float r1 = std::fma(__hip_erfinvb4, x1, __hip_erfinvb3); - float r2 = std::fma(r1, x1, __hip_erfinvb2); - float r3 = std::fma(r2, x1, __hip_erfinvb1); - ret = x4 / std::fma(r3, x1, __hip_erfinvb0); - } else { - float x1 = std::sqrt(-std::log((1 - x) / 2)); - float x2 = std::fma(__hip_erfinvc3, x1, __hip_erfinvc2); - float x3 = std::fma(x2, x1, __hip_erfinvc1); - float x4 = std::fma(x3, x1, __hip_erfinvc0); - - float r1 = std::fma(__hip_erfinvd2, x1, __hip_erfinvd1); - ret = x4 / std::fma(r1, x1, __hip_erfinvd0); - } - - ret = ret * sign; - x = x * sign; - - ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret)); - ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret)); - - return ret; - -} - -double __hip_host_erfinv(double x) -{ - double ret; - int sign; - if (x < -1 || x > 1){ - return NAN; - } - if (x == 0){ - return 0; - } - if (x > 0){ - sign = 1; - } else { - sign = -1; - x = -x; - } - if (x <= 0.7) { - double x1 = x * x; - double x2 = std::fma(__hip_erfinva3, x1, __hip_erfinva2); - double x3 = std::fma(x2, x1, __hip_erfinva1); - double x4 = x * std::fma(x3, x1, __hip_erfinva0); - - double r1 = std::fma(__hip_erfinvb4, x1, __hip_erfinvb3); - double r2 = std::fma(r1, x1, __hip_erfinvb2); - double r3 = std::fma(r2, x1, __hip_erfinvb1); - ret = x4 / std::fma(r3, x1, __hip_erfinvb0); - } else { - double x1 = std::sqrt(-std::log((1 - x) / 2)); - double x2 = std::fma(__hip_erfinvc3, x1, __hip_erfinvc2); - double x3 = std::fma(x2, x1, __hip_erfinvc1); - double x4 = std::fma(x3, x1, __hip_erfinvc0); - - double r1 = std::fma(__hip_erfinvd2, x1, __hip_erfinvd1); - ret = x4 / std::fma(r1, x1, __hip_erfinvd0); - } - - ret = ret * sign; - x = x * sign; - - ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret)); - ret -= (std::erf(ret) - x) / (2 / std::sqrt(HIP_PI) * std::exp(-ret * ret)); - - return ret; - -} - -float __hip_host_erfcinvf(float y) -{ - return __hip_host_erfinvf(1 - y); -} - -double __hip_host_erfcinv(double y) -{ - return __hip_host_erfinv(1 - y); -} - double __hip_host_j0(double x) { double ret, a = std::fabs(x); diff --git a/src/device_util.h b/src/device_util.h index ad8b2607dd..f942fdf5e5 100644 --- a/src/device_util.h +++ b/src/device_util.h @@ -128,12 +128,6 @@ __device__ double __hip_fast_dsqrt_ru(double x); __device__ double __hip_fast_dsqrt_rz(double x); __device__ void __threadfence_system(void); -float __hip_host_erfinvf(float x); -double __hip_host_erfinv(double x); - -float __hip_host_erfcinvf(float y); -double __hip_host_erfcinv(double y); - float __hip_host_j0f(float x); double __hip_host_j0(double x); diff --git a/src/math_functions.cpp b/src/math_functions.cpp index f66f0a4312..80ccece1a3 100644 --- a/src/math_functions.cpp +++ b/src/math_functions.cpp @@ -820,16 +820,6 @@ __host__ float modff(float x, float *iptr) return std::modf(x, iptr); } -__host__ float erfcinvf(float y) -{ - return __hip_host_erfcinvf(y); -} - -__host__ double erfcinv(double y) -{ - return __hip_host_erfcinv(y); -} - __host__ double fdivide(double x, double y) { return x/y; @@ -937,16 +927,6 @@ __host__ void sincospi(double x, double *sptr, double *cptr) *cptr = std::cos(HIP_PI*x); } -//__host__ float normcdfinvf(float x) -//{ -// return std::sqrt(2) * erfinvf(2*x-1); -//} - -//__host__ double normcdfinv(double x) -//{ -// return std::sqrt(2) * erfinv(2*x-1); -//} - __host__ float nextafterf(float x, float y) { return std::nextafter(x, y);