ERFC_SCALED(3) - [MATHEMATICS] Scaled complementary error function
result = erfc_scaled(x)
elemental real(kind=KIND) function erfc_scaled(x)real(kind=KIND),intent(in) :: x
o X is of type real of any valid kind o KIND is any kind valid for a real type o the result has the same characteristics as X
ERFC_SCALED(3) computes the exponentially-scaled complementary error function of X:
$$ e^{x^2} \frac{2}{\sqrt{\pi}} \int_{x}^{\infty} e^{-t^2} dt. $$
erfc_scaled(x)=exp(x*x)erfc(x)
NOTE1
The complementary error function is asymptotic to exp(-X2)/(X/PI). As such it underflows at approximately X >= 9 when using ISO/IEC/IEEE 60559:2011 single precision arithmetic. The exponentially-scaled complementary error function is asymptotic to 1/(X PI). As such it does not underflow until X > HUGE (X)/PI.
o X the value to apply the ERFC function to
The approximation to the exponentially-scaled complementary error function of X
Sample program:
program demo_erfc_scaled implicit none real(kind(0.0d0)) :: x = 0.17d0 x = erfc_scaled(x) print *, x end program demo_erfc_scaledResults:
> 0.833758302149981
Fortran 2008
ERF(3), EXP(3), ERFC(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
Nemo Release 3.1 | erfc_scaled (3fortran) | November 02, 2024 |