Fortran 90 Error Function
Contents |
it shall be scalar. Return value:The return value is a scalar of type REAL(*) and it is positive ( - 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 Option DERF(X) REAL(8) X REAL(8) gnu
erf(x)=2π∫ 0 xe −t 2dt. \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt. Standard Fortran 2008 and later Class Elemental function Syntax result = erf(x) https://gcc.gnu.org/onlinedocs/gcc-4.1.0/gfortran/ERF.html Arguments x - The type shall be real. Return value The return value is of type real, of the same kind as x and lies in the range −1≤erf(x)≤1-1 \leq erf http://fortranwiki.org/fortran/show/erf (x) \leq 1 . Example program test_erf real(8) :: x = 0.17_8 x = erf(x) end program test_erf category: intrinsics Revised on June 2, 2009 17:17:59 by Jason Blevins (152.3.10.27) (586 characters / 0.0 pages) Edit | Back in time (2 revisions) | See changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, Fortran 2008 This site is running on Instiki 0.19.7(MML+) Powered by Ruby on Rails 2.3.18
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 http://www.pgroup.com/userforum/viewtopic.php?p=9753&sid=da352f43ff90da87ba9fc1137f79b573 Current Version Information Licensing Generate Permanent Keys Generate Trial License Keys Trial License FAQ http://www.kurims.kyoto-u.ac.jp/~ooura/gamerf.html 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 & Presentations Articles Benchmarking Glossary User Forums Programming and error function 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 Forum Index -> Accelerator Programming View previous topic :: View next topic fortran 90 error 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 :: a2 = 0.0422820123d0 real*8 :: a3 = 0.0092705272d0 real*8 :: a4 = 0.0001520143d0 real*8
Package: Gamma / Log Gamma / Complex Gamma / Complex Log Gamma / Error / Complex Error Function in Single / Double / Quadruple Precision gamerf2a.doc : Document of "gamerf2a.f" (Japanese) gamedat2.lzh : Function Data of "gamerf2a.f" mathplus.h : Macros of Gamma / Error Functions cdgamma.c : Complex Gamma Function in C cdgamma.f : Complex Gamma Function in Fortran dcbrt.c : Cubic Root Function in C dcbrt.f : Cubic Root Function in Fortran derf.c : Error Function "erf(x)" in C derf.f : Error Function "erf(x)" in Fortran derfc.c : Error Function "erfc(x)" in C derfc.f : Error Function "erfc(x)" in Fortran dierfc.c : Inverse of Error Function "erfc^{-1}(x)" in C dierfc.f : Inverse of Error Function "erfc^{-1}(x)" in Fortran dgamma.c : Gamma Function in C dgamma.f : Gamma Function in Fortran dlgamma.c : Log Gamma Function in C dlgamma.f : Log Gamma Function in Fortran readme.txt : readme file Main Page