(1 - exp(-x)) / x, Taylor-safe at small x.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x |
pure function one_m_exp_x(x) result(f) !! (1 - exp(-x)) / x, Taylor-safe at small x. !$acc routine seq real(wp), intent(in) :: x real(wp) :: f if (x < 1.0e-4_wp) then f = 1.0_wp - x*(0.5_wp - x/6.0_wp) else f = (1.0_wp - exp(-x))/x end if end function one_m_exp_x