Fortran 95 Error Function
Contents |
type shall
Erfc
be REAL. Return value:The return value is of type REAL, of the same kind as X and lies in the range -1 \leq erf (x) \leq 1 . Example: program test_erf real(8) :: x = 0.17_8 x = erf(x) end program test_erf Specific names: Name Argument Return type Standard DERF(X) REAL(8) X REAL(8) GNU extension
HPC Platform Products PGI Products for Apple OS X PGI Products for Windows Free HPC Products Free PGI for OS X HPC Product Feature Comparison Services PGI Subscription Service PGI Premier Service Support Support Options Current Release Information Current Version Information Licensing Generate Permanent Keys Generate Trial License Keys Trial License FAQ Transfer License Locating Your PIN Licensing Troubleshooting FAQ Compatibility and Installation Licensing Compilation Linking Execution Portability Inter-language Support Request Download Free Trial Software Current Version Current Version Information Archive Releases Licensing Daemons Resources Documentation Porting & Tuning Guides Tutorial Videos PGInsider Newsletters White Papers & Specifications Technical Papers https://gcc.gnu.org/onlinedocs/gfortran/ERF.html & Presentations Articles Benchmarking Glossary User Forums Programming and Compiling Accelerator Programming Debugging and Profiling License and Installation Purchase Find a Reseller Product Configurator Quote Request Pricing End-user License Agreement Subscription Services Agreement Become a Reseller About Why Choose PGI News Center Job Openings Locations Contact PGI PGI User Forum Search Memberlist Register Profile Log in Something horrbily wrong with ERF(x) PGI User Forum http://www.pgroup.com/userforum/viewtopic.php?p=9753&sid=da352f43ff90da87ba9fc1137f79b573 Forum Index -> Accelerator Programming View previous topic :: View next topic Author Message alfvenwaveJoined: 08 Apr 2010Posts: 79 Posted: Wed Apr 27, 2011 5:52 am Post subject: Something horrbily wrong with ERF(x) I've been tearing my hair out over the last few days and have finally homed in on something that seems very wrong indeed. Here is some test code - all it should do is to return the real error function for the value 1.0: Code: function erf_stegun( x ) result( erf_x ) !------------------------------------------------------------------------------ ! ! *** Description: ! ! Real error function ERF(x). ! ! *** Details: ! ! Handbook of Mathematical Functions. Edited by Milton Abramowitz and ! Irene A. Stegun, Dover Publications, Inc., New York, 1965. ! ! Rational approximation for 0 <= x <= Inf. ! ! Error function and Fresnel Integrals, EQN. 7.1.28. ! Valid to |E(x)| <= 3e-7. Calculation in double precision, result returned ! in gpu precision. ! !------------------------------------------------------------------------------ implicit none real*8 :: x real*8 :: erf_x real*8 :: a1 = 0.0705230784d0 real*8
arbitrary positive integer order N, or for any positive non-integer order (an unusual feature). Routines are also available for the Gamma function, the logarithm of the Gamma function, the exponential integrals, http://people.sc.fsu.edu/~jburkardt/f_src/specfun/specfun.html the error function, the Psi function, and Dawson's integral. The original, true, correct https://docs.oracle.com/cd/E19422-01/819-3684/2_F95_Intrins.html (FORTRAN77) version of SPECFUN is available through NETLIB: http://www.netlib.org/specfun/index.html". Licensing: The computer code and data files described and made available on this web page are distributed under the GNU LGPL license. Languages: SPECFUN is available in a FORTRAN77 version and a FORTRAN90 version. Related Data and Programs: CORDIC, a FORTRAN90 library which use the error function CORDIC method to compute certain elementary functions. FN, a FORTRAN90 library which evaluates elementary and special functions, by Wayne Fullerton. G95_INTRINSICS, FORTRAN90 programs which demonstrate the use of intrinsic functions peculiar to the G95 FORTRAN compiler, which include Bessel J and Y functions, ERF and GAMMA. GSL, a C++ library which evaluates many special functions. MACHAR, a FORTRAN90 library which is used to compute machine arithmetic parameters. POLPAK, fortran 95 error a FORTRAN90 library which evaluates certain mathematical functions, especially some recursive polynomial families. SLATEC, a FORTRAN90 library which evaluates many special functions. SPECIAL_FUNCTIONS, a FORTRAN90 library which computes the Beta, Error, Gamma, Lambda, Psi functions, the Airy, Bessel I, J, K and Y, Hankel, Jacobian elliptic, Kelvin, Mathieu, Struve functions, spheroidal angular functions, parabolic cylinder functions, hypergeometric functions, the Bernoulli and Euler numbers, the Hermite, Laguerre and Legendre polynomials, the cosine, elliptic, exponential, Fresnel and sine integrals, by Shanjie Zhang, Jianming Jin; TEST_VALUES, a FORTRAN90 library which contains a few test values of many functions. TOMS644, a FORTRAN77 library which evaluates the Bessel I, J, K, Y functions, the Airy functions Ai and Bi, and the Hankel function, for complex argument and real order. TOMS715, a FORTRAN90 library which evaluates special functions, including the Bessel I, J, K, and Y functions of order 0, of order 1, and of any real order, Dawson's integral, the error function, exponential integrals, the gamma function, the normal distribution function, the psi function. This is a version of ACM TOMS algorithm 715. Author: The original FORTRAN77 version is by William Cody and Laura Stoltz. Reference: Donald Amos, Computation of Modified Bessel Functions and Their R
are grouped in this section by functionality as they appear in the Fortran 95 standard. The arguments shown are the names that can be used as argument keywords when using the keyword form, as in cmplx(Y=B, KIND=M, X=A). Consult the Fortran 95 standard for the detailed specifications of these generic intrinsic procedures. 2.1.1 Argument Presence Inquiry Function Generic Intrinsic Name Description PRESENT Argument presence 2.1.2 Numeric Functions Generic Intrinsic Name Description ABS (A) Absolute value AIMAG (Z) Imaginary part of a complex number AINT (A [, KIND]) Truncation to whole number ANINT (A [, KIND]) Nearest whole number CEILING (A [, KIND]) Least integer greater than or equal to number CMPLX (X [, Y, KIND]) Conversion to complex type CONJG (Z) Conjugate of a complex number DBLE (A) Conversion to double precision real type DIM (X, Y) Positive difference DPROD (X, Y) Double precision real product FLOOR (A [, KIND]) Greatest integer less than or equal to number INT (A [, KIND]) Conversion to integer type MAX (A1, A2 [, A3,...]) Maximum value MIN (A1, A2 [, A3,...]) Minimum value MOD (A, P) Remainder function MODULO (A, P) Modulo function NINT (A [, KIND]) Nearest integer REAL (A [, KIND]) Conversion to real type SIGN (A, B) Transfer of sign 2.1.3 Mathematical Functions Generic Intrinsic Name Description ACOS (X) Arccosine ASIN (X) Arcsine ATAN (X) Arctangent ATAN2 (Y, X) Arctangent COS (X) Cosine COSH (X) Hyperbolic cosine EXP (X) Exponential LOG (X) Natural logarithm LOG10 (X) Common logarithm (base 10) SIN (X) Sine SINH (X) Hyperbolic sine SQRT (X) Square root TAN (X) Tangent TANH (X) Hyperbolic tangent 2.1.4 Character Functions Generic Intrinsic Name Description ACHAR (I) Character in given position in ASCII collating sequence ADJUSTL (STRING) Adjust left ADJUSTR (STRING) Adjust right CHAR (I [, KIND]) Character in given position in processor collating sequence IACHAR (C) Position of a character in ASCII collating sequence ICHAR (C) Position of a character in processor collating sequence INDEX (STRING, SUBSTRING [, BACK]) Starting position of a substring LEN_TRIM (STRING) Length without trailing blank characters LGE (STRING_A, STRING_B) Lexically greater than or equal LGT (STRING_A, STRING_B) Lexically greater than LLE (STRING_A, STRING_B) Lexically less than or equal LLT (STRING_A, STRING_B) Lexically less t