! ef_f95.f90 demonstrate elementary functions in F0rtran 95 program ef_f95 implicit none double precision :: xx, yy, zz real :: x, y, z print *, 'elementary functions in Fortran 95' x = 0.5 z = 0.5 xx = 0.5 zz = 0.5 y = abs(x) ! native for all numeric data types yy = abs(xx) y = sqrt(x) yy = sqrt(xx) y = x ** z yy = xx ** zz y = log(x) yy = log(xx) y = log10(x) yy = log10(xx) ! y = log2(x) not available log(x)/log(2.0) y = exp(x) yy = exp(xx) y = sin(x) yy = sin(xx) y = cos(x) yy = cos(xx) y = tan(x) yy = tan(xx) ! y = cot(x) not available 1.0/tan(x) ! y = csc(x) not available 1.0/sin(x) ! y = sec(x) not available 1.0/cos(x) y = asin(x) yy = asin(xx) y = acos(x) yy = acos(xx) y = atan(x) yy = atan(xx) ! y = acot(x) not available 1.0/atan(x) y = sinh(x) yy = sinh(xx) y = cosh(x) yy = cosh(xx) y = tanh(x) yy = tanh(xx) ! y = coth(x) not available 1.0/tanh(x) ! y = asinh(x) not available ! y = acosh(x) ! y = atanh(x) ! y = acoth(x) print *, 'end ef_f95.f90, no output expected' end program ef_f95