SINH(3) - [MATHEMATICS:TRIGONOMETRIC] Hyperbolic sine function
result = sinh(x)
elemental TYPE(kind=KIND) function sinh(x)TYPE(kind=KIND) :: x
o TYPE may be real or complex o KIND may be any kind supported by the associated type. o The returned value will be of the same type and kind as the argument.
SINH(3) computes the hyperbolic sine of X.
The hyperbolic sine of x is defined mathematically as:
sinh(x) = (exp(x) - exp(-x)) / 2.0
o X : The value to calculate the hyperbolic sine of
The result has a value equal to a processor-dependent approximation to sinh(X). If X is of type complex its imaginary part is regarded as a value in radians.
Sample program:
program demo_sinh use, intrinsic :: iso_fortran_env, only : real32, real64, real128 implicit none real(kind=real64) :: x = - 1.0_real64 real(kind=real64) :: nan, inf character(len=20) :: lineResults:! basics print *, sinh(x) print *, (exp(x)-exp(-x))/2.0
! sinh(3) is elemental and can handle an array print *, sinh([x,2.0*x,x/3.0])
! a NaN input returns NaN line=NAN read(line,*) nan print *, sinh(nan)
! a Inf input returns Inf line=Infinity read(line,*) inf print *, sinh(inf)
! an overflow returns Inf x=huge(0.0d0) print *, sinh(x)
end program demo_sinh
> -1.1752011936438014 > -1.1752011936438014 > -1.1752011936438014 -3.6268604078470190 -0.33954055725615012 > NaN > Infinity > Infinity
Fortran 95 , for a complex argument Fortran 2008
ASINH(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
o Wikipedia:hyperbolic functions
Nemo Release 3.1 | sinh (3fortran) | November 02, 2024 |