functions.f90 File Reference

Go to the source code of this file.

Modules

module  functions
 Mathematical functions.
 

Functions/Subroutines

elemental real function, public functions::asinh (x)
 inverse hyperbolic sine function More...
 
elemental real function, public functions::acosh (x)
 inverse hyperbolic cosine function More...
 
elemental real function, public functions::atanh (x)
 inverse hyperbolic tangens function More...
 
elemental real function, public functions::heaviside (x, a)
 step function More...
 
elemental real function, public functions::barrier (x, a, b)
 barrier function More...
 
elemental subroutine, public functions::normalrand (u1, u2, x, y)
 Box-Muller alg. for gaussian distributed random variables input are uniform distributed random variables [0,1) More...
 
elemental subroutine, public functions::ellipticintegrals (k, Kell, Eell)
 compute the complete elliptic integrals of first and second kind using the AGM method (arithmetic-geometric-mean); More...
 
elemental real function, public functions::ellipticintegral_k (k)
 compute the complete elliptic integral of the first kind using the AGM method (arithmetic-geometric-mean) More...
 
elemental real function, public functions::ellipticintegral_e (k)
 compute the complete elliptic integral of the second kind using the AGM method (arithmetic-geometric-mean) More...
 
elemental real function functions::rf (x, y, z)
 Computes Carlson's elliptic integral of the first kind R_F(x,y,z), y,y,z > 0. One can be zero. TINY must be at least 5x the machine underflow limit, BIG at most one fifth of the machine overflow limit. similar to Numerical recipes 2nd edition. More...
 
elemental real function functions::rd (x, y, z)
 Computes Carlson's elliptic integral of the second kind R_D(x,y,z), y,y > 0. One can be zero. z > 0. TINY must be at least twice -2/3 power of the machine underflow limit, BIG at most 0.1 x ERRTOL times the -2/3 power of the machine overflow limit. similar to Numerical recipes 2nd edition. More...
 
elemental real function, public functions::incompleteellipticintegral_f (phi, ak)
 
elemental real function, public functions::incompleteellipticintegral_e (phi, ak)
 Legendre elliptic integral of the second kind E(phi,k), evaluated using Carlson's function R_D and R_F. The argument ranges are 0 <= phi <= pi/2, 0 <= k*sin(phi) <= 1 similar to Numerical recipes 2nd edition. More...
 
pure subroutine, public functions::legendrepolynomials (l, x, P)
 
elemental real function functions::legendrepolynomial_one (l, x, Plminus1, Plminus2)
 
elemental real function functions::legendrepolynomial_all (l, x)
 
elemental real function, public functions::legendrefunction_qminhalf (x)
 Computation of the order 0 and -1/2 degree Legendre function of the second kind Q_{-1/2} using the AGM method (arithmetic-geometric-mean) More...
 
elemental real function, public functions::bessel_i0 (x)
 Compute the modified Bessel function of the first kind as polynomial expansion, which has been proposed by Numerical Recipes in fortran, Second Edition on page 229ff. Nontheless the implementation is different and only the idea is used. More...
 
elemental real function, public functions::bessel_i1 (x)
 Compute the modified Bessel function of the first kind as polynomial expansion, which has been proposed by Numerical Recipes in fortran, Second Edition on page 229ff. Nontheless the implementation is different and only the idea is used. More...
 
elemental real function, public functions::bessel_k0 (x)
 Compute the modified Bessel function of the second kind as polynomial expansion, which has been proposed by Numerical Recipes in fortran, Second Edition on page 229ff. Nontheless the implementation is different and only the idea is used. More...
 
elemental real function, public functions::bessel_k0e (x)
 Compute the exponential scaled modified Bessel function of the second kind e.g. K0e = EXP(x) * K0(x) as polynomial expansion, using coefficients from Abramowitz p.379 (http://people.math.sfu.ca/~cbm/aands/page_379.htm) for x >= 2, and exp(x)*K0(x) directly for 0<x<2. More...
 
elemental real function, public functions::bessel_k1 (x)
 Compute the modified Bessel function of the second kind as polynomial expansion, which has been proposed by Numerical Recipes in fortran, Second Edition on page 229ff. Nontheless the implementation is different and only the idea is used. More...
 
elemental real function, public functions::ei (x)
 Computes the exponential integral Ei(x) for x != 0 Ei(x) := int_-oo^x exp(t)/t dt Implementation similar to: http://www.mymathlib.com/functions/exponential_integrals.html. More...
 
elemental real function functions::continued_fraction_ei (x)
 
elemental real function functions::power_series_ei (x)
 
elemental real function functions::argument_addition_series_ei (x)
 
elemental real function, public functions::errorfunc (x)
 returns the error function of argument x calculation of error fuction and complementary errorfunction are based on M. Abramowitz and I. A. Stegun: Handbook of Mathematical Functions, Applied Mathematics Series. National Bureau of Standards, Vol. 55, 1964 online resource: http://people.math.sfu.ca/~cbm/aands/ and "Rational Chebyshev approximations for the error function" by W. J. Cody, Math. Comp., 1969, PP. 631-638. Coefficients for the Polynoms are taken from the library routine http://www.netlib.org/specfun/erf written by W. J. Cody More...
 
elemental real function, public functions::comperrorfunc (x)
 
elemental real function functions::codyerfapprox (x)
 
elemental real function functions::codycerf1approx (x)
 Cody approximation for complementary error function for 0.46875 < |x| < 4. More...
 
elemental real function functions::codycerf2approx (x)
 Cody approximation for complementary error function for |x| > 4. More...
 
elemental real function, public functions::inverf (x)
 Inverse of the error function Argument of this function has to be in ]-1,1[, returns huge(1.0) for values x with abs(x)>=1 without an error !!!! uses and idea of P.J. Acklam http://home.online.no/~pjacklam/notes/invnorm/ to calculate the inverse using the Halley root finding algorithm Halley is preferable to Newton- Raphson as the second derivative can be computed easily f''(y) = -2y*f'(y) for f(y)=erf(y) More...
 
elemental real function, public functions::gamma (x)
 Compute the Gamma function for arguments != 0,-1,-2,..

x Gamma(x)

1/3 2.678938534708 0.5 1.772453850906 -0.5 -3.544907701811 -1.5 2.363271801207 5.0 24.000000000000. More...
 
elemental real function, public functions::lngamma (x)
 computes the logarithm of the gammafunction with Lanczos approximation found in Numerical Recipes for C++ p. 257 (different implementation) coefficiants from Paul Godfrey for g=607/128 and N=15 http://my.fit.edu/~gabdo/gamma.txt Gamma(x+1)=x! More...
 

Variables

real, parameter functions::pi = 3.14159265358979323846
 
real, parameter functions::sqrt_two = 1.41421356237309504880
 
real, parameter functions::eps_agm = EPSILON(EPS_AGM)
 
integer, parameter functions::max_agm_iterations = 20
 
integer functions::iii
 
integer, parameter functions::max_pl_coeff = 20
 
real, dimension(max_pl_coeff), parameter functions::pl_coeff = (/ (iii/(iii+1.0), iii=1,MAX_PL_COEFF) /)