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.718282
     given the complex value  (3.000000,4.000000)
     exp(x) is (-13.12878,-15.20078)
     is the same as (-13.12878,-15.20078)
     maximum real component   88.72284
     maximum doubleprecision component   709.782712893384

STANDARD

FORTRAN 77

SEE ALSO

o LOG(3)

RESOURCES

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


Nemo Release 3.1 exp (3fortran) April 28, 2024
Generated by manServer 1.08 from 9729f67a-3fcf-4421-9289-45f31dcb2d3c using man macros.