@@ -557,6 +557,51 @@ CUDA_HOST_DEVICE ValueAndPushforward<T, dT> expm1l_pushforward(T x, dT d_x) {
557557 return expm1_pushforward (x, d_x);
558558}
559559
560+ #if __cplusplus >= 201703L
561+ // 2.4 expint, expintf, expintl
562+ template <typename T> CUDA_HOST_DEVICE inline T expint_primal (T x) {
563+ #if defined(__cpp_lib_math_special_funcs) || defined(__STDCPP_MATH_SPEC_FUNCS__)
564+ return ::std ::expint (x);
565+ #else
566+ return T (0 );
567+ #endif
568+ }
569+
570+ template <typename T> CUDA_HOST_DEVICE inline T expintf_primal (T x) {
571+ #if defined(__cpp_lib_math_special_funcs) || defined(__STDCPP_MATH_SPEC_FUNCS__)
572+ return ::std ::expintf (x);
573+ #else
574+ return T (0 );
575+ #endif
576+ }
577+
578+ template <typename T> CUDA_HOST_DEVICE inline T expintl_primal (T x) {
579+ #if defined(__cpp_lib_math_special_funcs) || defined(__STDCPP_MATH_SPEC_FUNCS__)
580+ return ::std ::expintl (x);
581+ #else
582+ return T (0 );
583+ #endif
584+ }
585+
586+ template <typename T, typename dT>
587+ CUDA_HOST_DEVICE ValueAndPushforward<T, dT> expint_pushforward (T x, dT d_x) {
588+ return {static_cast <T>(expint_primal (x)),
589+ static_cast <dT>((::std ::exp (x) / x) * d_x)};
590+ }
591+
592+ template <typename T, typename dT>
593+ CUDA_HOST_DEVICE ValueAndPushforward<T, dT> expintf_pushforward (T x, dT d_x) {
594+ return {static_cast <T>(expintf_primal (x)),
595+ static_cast <dT>((::std ::exp (x) / x) * d_x)};
596+ }
597+
598+ template <typename T, typename dT>
599+ CUDA_HOST_DEVICE ValueAndPushforward<T, dT> expintl_pushforward (T x, dT d_x) {
600+ return {static_cast <T>(expintl_primal (x)),
601+ static_cast <dT>((::std ::exp (x) / x) * d_x)};
602+ }
603+ #endif
604+
560605// 3. Logarithmic Functions
561606
562607// 3.1 log, logf, logl
@@ -1351,6 +1396,11 @@ using std::expl_pushforward;
13511396using std::expm1_pushforward;
13521397using std::expm1f_pushforward;
13531398using std::expm1l_pushforward;
1399+ #if __cplusplus >= 201703L
1400+ using std::expint_pushforward;
1401+ using std::expintf_pushforward;
1402+ using std::expintl_pushforward;
1403+ #endif
13541404
13551405// 3. Logarithmic Functions
13561406using std::log10_pushforward;
0 commit comments