Manual Reference Pages  - exp (3fortran)

NAME

EXP(3) - [MATHEMATICS] Base-e exponential function

SYNOPSIS

result = exp(x)

         elemental TYPE(kind=KIND) function exp(x)

TYPE(kind=KIND),intent(in) :: x

CHARACTERISTICS

o X may be real or complex of any kind.
o The return value has the same type and kind as X.

DESCRIPTION

EXP(3) returns the value of e (the base of natural logarithms) raised to the power of X.

"e" is also known as Euler’s constant.

If X is of type complex, its imaginary part is regarded as a value in radians such that if (see Euler’s formula):

        cx=(re,im)

then

        exp(cx) = exp(re) * cmplx(cos(im),sin(im),kind=kind(cx))

Since EXP(3) is the inverse function of LOG(3) the maximum valid magnitude of the real component of X is LOG(HUGE(X)).

OPTIONS

o X : The type shall be real or complex.

RESULT

The value of the result is E**X where E is Euler’s constant.

If X is of type complex, its imaginary part is regarded as a value in radians.

EXAMPLES

Sample program:

    program demo_exp
    implicit none
    real :: x, re, im
    complex :: cx

x = 1.0 write(*,*)"Euler’s constant is approximately",exp(x)

!! complex values ! given re=3.0 im=4.0 cx=cmplx(re,im)

! complex results from complex arguments are Related to Euler’s formula write(*,*)’given the complex value ’,cx write(*,*)’exp(x) is’,exp(cx) write(*,*)’is the same as’,exp(re)*cmplx(cos(im),sin(im),kind=kind(cx))

! exp(3) is the inverse function of log(3) so ! the real component of the input must be less than or equal to write(*,*)’maximum real component’,log(huge(0.0)) ! or for double precision write(*,*)’maximum doubleprecision component’,log(huge(0.0d0))

! but since the imaginary component is passed to the cos(3) and sin(3) ! functions the imaginary component can be any real value

end program demo_exp

Results:

     >  Euler’s constant is approximately   2.71828175   
     >  given the complex value              (3.00000000,4.00000000)
     >  exp(x) is           (-13.1287832,-15.2007847)
     >  is the same as           (-13.1287832,-15.2007847)
     >  maximum real component   88.7228394   
     >  maximum doubleprecision component   709.78271289338397    

STANDARD

FORTRAN 77

SEE ALSO

o LOG(3)

RESOURCES

o Wikipedia:Exponential function
o Wikipedia:Euler’s formula
Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 exp (3fortran) November 02, 2024
Generated by manServer 1.08 from edf15a8d-004a-461d-95a1-d81183f4ed6b using man macros.