@@ -519,7 +519,11 @@ namespace special {
519519// /
520520// / @returns 1/sqrt(pi)
521521// ------------------------------------------------------------------------------
522+ #if __cplusplus >= 202002L
523+ template <std::floating_point T>
524+ #else
522525 template <typename T>
526+ #endif
523527 T isqpi () {
524528 return static_cast <T> (1 )/sqrt (static_cast <T> (M_PI));
525529 }
@@ -1461,20 +1465,24 @@ namespace special {
14611465// / @param[in] y imaginary argument.
14621466// / @returns erf(x+iy)
14631467// ------------------------------------------------------------------------------
1468+ #if __cplusplus >= 202002L
1469+ template <std::floating_point T>
1470+ #else
14641471 template <typename T>
1472+ #endif
14651473 complex_type<T> taylor_erfi (const T x, const T y) {
1466- const T x2 = sq (x);
1467- const T y2 = sq (y);
1468- const T expy2 = exp (y2);
1469- return expy2*complex_type<T> (x*(static_cast <T> (1.1283791670955125739 ) -
1470- x2*(static_cast <T> (0.37612638903183752464 ) +
1471- static_cast <T> (0.75225277806367504925 )*y2) +
1472- x2*x2*(static_cast <T> (0.11283791670955125739 ) +
1473- y2*(static_cast <T> (0.45135166683820502956 ) +
1474- static_cast <T> (0.15045055561273500986 )*y2))),
1475- (w_im (y) - x2*y*(static_cast <T> (1.1283791670955125739 ) -
1476- x2*(static_cast <T> (0.56418958354775628695 ) +
1477- static_cast <T> (0.37612638903183752464 )*y2))));
1474+ const T x2 = sq (x);
1475+ const T y2 = sq (y);
1476+ const T expy2 = exp (y2);
1477+ return expy2*complex_type<T> (x*(static_cast <T> (1.1283791670955125739 ) -
1478+ x2*(static_cast <T> (0.37612638903183752464 ) +
1479+ static_cast <T> (0.75225277806367504925 )*y2) +
1480+ x2*x2*(static_cast <T> (0.11283791670955125739 ) +
1481+ y2*(static_cast <T> (0.45135166683820502956 ) +
1482+ static_cast <T> (0.15045055561273500986 )*y2))),
1483+ (w_im (y) - x2*y*(static_cast <T> (1.1283791670955125739 ) -
1484+ x2*(static_cast <T> (0.56418958354775628695 ) +
1485+ static_cast <T> (0.37612638903183752464 )*y2))));
14781486 }
14791487
14801488// ------------------------------------------------------------------------------
0 commit comments